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

Deadly 提交于 2019-12-19 03:18:41

问题


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.


回答1:


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



回答2:


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".




回答3:


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




回答4:


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.




回答5:


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?



来源:https://stackoverflow.com/questions/5300565/deploy-more-than-one-wp7-app-with-same-visual-studio-solution

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