Over a million developers have joined DZone.

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

DZone's Guide to

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

· Mobile Zone
Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

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.

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda


Published at DZone with permission of Toni Petrina, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}