XBAP (XAML Browser Application) is a new Windows technology used for creating Rich Internet Applications. While windows applications are normally compiled to an .exe file, browser applications are compiled to an extension .xbap and can be run inside Internet Explorer.
Xbap applications are run within a security sandbox to prevent untrusted applications from controlling local system resources. (e.g deleting local files)
But If your application requires peripherals access, the user can run an xbap in full trust mode. Here is how you can set up a XBAP application in full trust mode.
Here in this application, the main page just has a Button. When clicked, the eventhandler opens the COM3 port and flushes data.
The following code prints a ticket on the COM3 port.
public void button_click(object sender, RoutedEventArgs e)
System.Text.Encoding enc = System.Text.Encoding.ASCII;
// Instantiate the communications // port with some basic settings
SerialPort port = new SerialPort("COM3", 115200, Parity.None, 8, StopBits.One);
// Open the port for communications
System.Console.WriteLine("Com port occupied. Please choose another port");
Source code here.