Creating an application with multiple targets in Windows Phone 7

女生的网名这么多〃 提交于 2019-12-23 03:47:09

问题


Is there any way to create a project/application which will have multiple targets.
Its same as how we create multiple targets for an iPhone application in XCode.
Basically I have an app which has to be made for different targets, with almost all the similar functionalities but with little change.


回答1:


You can use Configuration Manager to add additional configurations to the list of Debug and Release. Then for each configuration go to Project/Properties/Build/Conditional compilation symbols and add a symbol used with your configuration or target, eg. make it SILVERLIGHT;WINDOWS_PHONE;CUSTOMVERSION1

Then in your code you can say

#if CUSTOMVERSION1
    Debug.WriteLine("This is a CUSTOMVERSION1");
#else
    Debug.WriteLine("This is not CUSTOMVERSION1");
#endif

Otherwise - if you want to make bigger changes - you would create another project and link files from one project to another project - project/Add/Existing Item//Add As Link(an option in the "Add" button menu). You can then add more files or add different versions of these files as needed. You could use Project Linker to do it faster.



来源:https://stackoverflow.com/questions/8337087/creating-an-application-with-multiple-targets-in-windows-phone-7

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