Search code examples
visual-studio-2010deploymentwindows-phone-7xap

Deploy more than one WP7 App with same Visual Studio Solution?


How can I deploy more than one WP7 app with the same Visual Studio solution? What do I need to change to achieve this? Changing Xap file name and assembly GUID and title does not achieve it. In fact VS overrides the old one with new title but does not deploy a separate app

Background: We have a Lite and Pro app and I want to be able to deploy both versions onto the phone.

EDIT:

Trial API is not an option for us. We have thought about that but decided to not use it.


Solution

  • I have created prebuild events, which is based on the current configuration name. This event replaces the app configuration (WMAppManifest.xml, SplashScreenImage.jpg) in the solution.

    Example:

    echo "$(ConfigurationName)"
    
    if "$(ConfigurationName)" == "Lite" goto :copyLite
    if "$(ConfigurationName)" == "PRO" goto :copyPro
    
    echo "Unknown Configuration"
    goto :end
    
    :copyLite
    echo "copy lite"
      copy "$(ProjectDir)Resources\PreBuildEvent\Lite\WMAppManifest.xml" "$(ProjectDir)\Properties\" /y
      copy "$(ProjectDir)SplashScreenImageLite.jpg" "$(ProjectDir)SplashScreenImage.jpg" /y
    goto :end
    
    :copyPro
    echo "copy pro"
      copy "$(ProjectDir)Resources\PreBuildEvent\Pro\WMAppManifest.xml" "$(ProjectDir)\Properties\" /y
      copy "$(ProjectDir)SplashScreenImagePro.jpg" "$(ProjectDir)SplashScreenImage.jpg" /y
    
    goto :end
    
    :end