Does permission set of partial trust change in the Local Intranet and Internet?

Yes. The permission set of a partial trust changes based on the zone it is run from. It has more permission when run in local intranet than when run using the internet. In the default permission set of partial trust, the following permissions are restricted when the application is run from the internet. Accessing DNS server. Reading Environment variables. File dialogs other than open file dialogs. Assembly isolation by user. Default printing. Assert granted permission.

How to get data from database in XBAP application ?

XBAP application runs with partial trust security and therefore the sandbox does not allow the XBAP application to read data from a database directly. In order to read data from the database, a web service can be used to read the data from the database in the local storage and return the dataset back to the XBAP application.

I am able to access the registry using full trust XBAP application in debug mode, when hosted in an intranet, the application crashes. What do I do?

The application crashes due to insufficient access to registry even if you have a local intranet certificate. The issue is, you get access to the registry using the CLR in debug mode, whereas when hosted in local intranet, NT security restricts you from accessing the registry, giving full access to registry in the NT security to the administrators and power users group.

How do I assign full trust to an XBAP application ?

Full trust permission can be assigned using ‘Security’ tab of the project properties. By selecting ‘This is a full trust application’ option in the security tab full trust can be assigned to the XBAP application. But be aware that it might cause security issues to your customer’s machine.

How can I use a WindowsFormsHost element to host a System.Windows.Forms ?

It can be done with the following code : [XAML] <Window x:Class=’HostingWfInWpf.Window1′ xmlns=’http://schemas.microsoft.com/winfx/2006/xaml/presentation’ xmlns:x=’http://schemas.microsoft.com/winfx/2006/xaml’ xmlns:wf=’clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms’ Title=’HostingWfInWpf’ > <Grid> <WindowsFormsHost> <wf:MaskedTextBox x:Name=’mtbDate’ Mask=’00/00/0000’/> </WindowsFormsHost> </Grid> </Window>