在Windows Phone 7中创建具有多个目标的应用程序 [英] Creating an application with multiple targets in Windows Phone 7

查看:99
本文介绍了在Windows Phone 7中创建具有多个目标的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以创建具有多个目标的项目/应用程序.
与我们在XCode中为iPhone应用程序创建多个目标的方法相同.
基本上,我有一个必须制作的应用程序针对不同的目标,几乎具有所有相似的功能,但变化很小.

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.

推荐答案

您可以使用配置管理器将其他配置添加到调试和发布"列表中.然后,对于每种配置,请转到项目/属性/构建/条件编译"符号,并添加用于您的配置或目标的符号,例如.将其设置为SILVERLIGHT; WINDOWS_PHONE; CUSTOMVERSION1

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.

这篇关于在Windows Phone 7中创建具有多个目标的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆