Alex Rivera | Logout

Modifying WMAppManifest.xml based on Build Configuration

Asked 2010-12-02T16:51:09.913
11

I would like to release to distinct flavours of my app and would like to indicate this in the application name displayed on the phone. As far as I know for Silverlight Phone Apps the name is solely determined by WMAppManifest.xml. Therefore I would like to modify the application title at build time based on my Build Configuration. Any suggestions?

Edit
Report

1 Answer

4

You can use the pre-build step (Project Properties -> Build Events -> Pre-Build event command line) in the project properties with conditional command-lines to achieve this.

Having files for each version and then copying over the default to replace the data there. You can also set up your icons to use this same system! :)

if $(ConfigurationName) == Phone_Free_Debug (
  copy /Y $(ProjectDir)Properties\WMAppManifest_Free.xml $(ProjectDir)Properties\WMAppManifest.xml 
  copy /Y $(ProjectDir)173x173icon_Free.png $(ProjectDir)173x173icon.png
  copy /Y $(ProjectDir)200x200icon_Free.png $(ProjectDir)200x200icon.png
)
if $(ConfigurationName) == Phone_Free_Release  (
  copy /Y $(ProjectDir)Properties\WMAppManifest_Free.xml $(ProjectDir)Properties\WMAppManifest.xml 
  copy /Y $(ProjectDir)173x173icon_Free.png $(ProjectDir)173x173icon.png
  copy /Y $(ProjectDir)200x200icon_Free.png $(ProjectDir)200x200icon.png
)

if $(ConfigurationName) == Phone_Debug  (
  copy /Y $(ProjectDir)Properties\WMAppManifest_Paid.xml $(ProjectDir)Properties\WMAppManifest.xml 
  copy /Y $(ProjectDir)173x173icon_Paid.png $(ProjectDir)173x173icon.png
  copy /Y $(ProjectDir)200x200icon_Paid.png $(ProjectDir)200x200icon.png
)
if $(ConfigurationName) == Phone_Release  (
  copy /Y $(ProjectDir)Properties\WMAppManifest_Paid.xml $(ProjectDir)Properties\WMAppManifest.xml 
  copy /Y $(ProjectDir)173x173icon_Paid.png $(ProjectDir)173x173icon.png
  copy /Y $(ProjectDir)200x200icon_Paid.png $(ProjectDir)200x200icon.png
)
answered 2011-11-03T04:27:26.603

Your Answer