Xaml Browser Application(Xbap) is a part of Wpf that runs inside the browser. Xbap applications combine features of both web and rich window based applications. Generally xbap runs in Sandbox (Partial trust) environment where application has access to limited system resources. In this article, I will discuss various issues I have worked on while developing Xbap application like
- “Trust Not Granted” error.
- Installing certificates for full trust Xbap application on client machines.
- How to use 3rd party dll in your Xbap application etc.
If you are new to xbap, you must know that for using xbap application user must have either Windows vista or .net 3.0 framework on their System. .net 3.5 also has support for mozilla firefox and WCF service. You can deploy xbap application either in partial trust or in full trust and application will not be installed but cached into client machine. In partial trust you cannot use features like accessing client file system,common dialogs, working with registry etc , so if you publish application with above features in partial trust, you will get “Trust Not granted” error. To resolve this:-
- Add Unrestricted=”true” into permission set of app.manifest file of your project.
- Sign the clickonce manifest with certificate and install certificate in client machine. Installation of certificate can also automated, see this link for more info.
- Add Certificate in Trusted Publishers and Trusted Root Store of browser.
When you are using 3rd party dll in your xbap application like OpenNETCF.Desktop.Communication.dll then it will give error “Assembly generation failed — Referenced assembly ‘OpenNETCF.Desktop.Communication’ does not have a strong name”,this is because it is not signed using Certificate which you are using to sign your app.manifest. You can resolve this in 2 ways:-
- Sign your assembly:- sn -R “YourAssemblyName.dll” “yourpublickey.snk”
- Or you can download the source code for that dll , add it in your project and then compile your project.
One more thing you can also add support url in Publish>Options>Support Url where user can navigate in case if there is some error in application which can have information regarding how to manually install certificate among other support information .Hope this post will help developers trying their hand at Xbap applications.
