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

↘锁芯ラ 提交于 2019-11-30 21:44:21

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

I would recommend you consider the Trial API. It's the preferred WP7 implementation for what you are trying to accomplish. But if you have a need to achieve two apps that share resources, I would recommend you structure your solution into multiple projects. Each phone application should be its own project. Then create class projects that share elements among both "applications". Each phone project will compile into a separate "application".

If you want to achieve two different XAP installations from the same project, then you only need to change the Title and ProductID GUID information inside the Properties/WMAppManifest.xml file - although you will probably also want to change other things too - e.g. the icons, the splashscreen and some "about" information

If the two apps are different projects within the same solution you can control which ones get deployed on a build using the configuration manager.

If you 're not puting multiple related projects int eh same solution, consider tyring it. I find this a great way of managing multiple related projects.

You can choose to deploy the entire solution or just the current startup project in the Build menu. If they are not both part of the same solution, then, no, you can't do that. But you could write a command line script that uses the deployment tool, perhaps?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!