Welcome to David Sandor Sign in | Join | Help
in Search

Professional Software Architecture

Convert a WPF Browser Application project to a WPF Application

So I started an application as a WPF Browser Application (XBAP – Xaml Browser APplication) and quickly noticed that I needed to do some things that really should be in a stand alone app for CAS reasons.  I found a blog entry by Karen Corby that showed how to do this way back in ‘06.  She wrote a cool Visual Studio project template that would let you target XBAP vs. Stand Alone.

In 2009 this is still applicable.  Here is what she said to edit in your CSPROJ file to accomplish the change.

You can do this by manually editing the .csproj or .vbproj.

There are three main tags involved in making something an “XBAP”:

    <HostInBrowser>True</HostInBrowser>
    <Install>False</Install>
    <TargetZone>Internet</TargetZone>

Other tags are required for the “XBAP” debug experience, etc:

    <EnableSecurityDebugging>false</EnableSecurityDebugging>
    <MapFileExtensions>False</MapFileExtensions>
    <StartAction>Program</StartAction>
    <StartProgram>$(WINDIR)\System32\PresentationHost.exe</StartProgram>
    <ApplicationExtension>.xbap</ApplicationExtension>
    <StartArguments>-debug “$(MSBuildProjectDirectory)\bin\$(Configuration)\$(AssemblyName)
$(ApplicationExtension)”</StartArguments>

If you comment out all of the above tags and add…

    <Install>True</Install>

…your app will run as a standalone.

http://scorbs.com/2006/06/04/vs-template-flexible-application

Published Monday, June 01, 2009 6:02 PM by david

Comments

No Comments
Anonymous comments are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems