{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner

Using Different WMAppManifest Files for Release and Debug Builds – Part Deux

Awhile ago I wrote a post describing how to change your application’s name when deploying from Visual Studio in order to differentiate Store version from your development version. To do that, I used Pre-build events to replace the WMAppManifest.xml file with Debug or Release version.

There is another way to do that – by using MSBuild.

First, create two extra WMAppManifest.xml files and name them WMAppManifest.Debug.xml andWMAppManifest.Release.xml in the Properties folder. Change the application’s title to something else in the Debug version, and use the desired name in the Release version. I recommend adding a ! before your application’s name. This way your application will be at the top of the applications list.

Both debug and release manifests along with the real one

Now, right click on the project file and select Unload Project. After the project is unloaded, right click again and click Edit YOURPROJECTNAME.csproj to open the project file. Scroll down until you find comment about modifying build process. Immediately after add the following XML:

<Target Name="BeforeBuild">
	<Delete Files="Properties\WMAppManifest.xml" />
		Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
		Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />

Save the file and reload the project. Similarly to the technique used in the other blog post, if we are in debug configuration, the debug version will be copied over the real WMAppManifest.xml file and release version will be copied in release configuration.

Of course, if you have changed your configurations, you need to adjust the XML above. That’s it, don’t forget to add exclamation point before Title in the Debug build to ensure top location for your application.

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks