Creating A Full Trust Avalon Web Browser (.xbap) Application

I recently needed to create a full trust .xbap application on the November CTP.  As you may know, Avalon Web Browser applications run in a sandbox, which allows them to be installed without any security prompts.  However, there are cases, such as intranet applications, where allows an in-browser application to do more makes sense.  It took some help from the Avalon team to know how to make this work, which I thought I’d share to the world.  For some more links on this, see:


 Here are the steps:

1. Change the TargetZone of the appliction to custom.  This can be done manually by hacking the .proj file or can be done in Visual Studio by going to Project Properties, going to the Security tab, and changing the dropdown to (custom).

2. Add the Unrestricted=”true” attribute to the manifest of the appliction, which is located in the Properties folder.  The manifest should look something like this:

<?xml version=”1.0″ encoding=”utf-8″?>
<asmv1:assembly manifestVersion=”1.0″ xmlns=”urn:schemas-microsoft-com:asm.v1″ xmlns:asmv1=”urn:schemas-microsoft-com:asm.v1″ xmlns:asmv2=”urn:schemas-microsoft-com:asm.v2″ xmlns:xsi=”“>
  <trustInfo xmlns=”urn:schemas-microsoft-com:asm.v2″>
        <defaultAssemblyRequest permissionSetReference=”Custom” />
        <PermissionSet class=”System.Security.PermissionSet”


3. Deploy the application using the Visual Studio Publish Wizard.

4. If you launch the application from the file system aka local zone, all will be hunky dory.  However, if you want to deploy this from the web, the certificate used to sign the manifest will have to be added to the Trusted Publishers store within Internet Explorer.  By default, VS generates a .pfx key when you create a Web Browser application.  Of course, real deployments, a company issued certificate would be more appropriate to use.  Getting a cert into the store can be done by double clicking the cert or by using the certmgr tool with the appropriate commandline switches.

Comments (3)

  1. Pour r&#233;pondre &#224; une question qui m’a &#233;t&#233; pos&#233;e lors de ma pr&#233;sentation&amp;nbsp; aux Open Days 2006 des Xaml…

  2. Pour r&amp;eacute;pondre &amp;agrave; une question qui m&amp;#39;a &amp;eacute;t&amp;eacute; pos&amp;eacute;e aux Open Days 2006

  3. Driving .NET says:

    After reading this post by Karsten, I created a WPF XBAP project that displays the ClassicReports designer