在解决方案中跨多个项目设置项目设置 [英] Setting Project Setting Across Multiple Projects in a Solution

查看:75
本文介绍了在解决方案中跨多个项目设置项目设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有谁知道是否可以在解决方案中的多个项目中设置相同的设置(例如,如果我想同时从多个项目中删除TRACE符号).

我曾经在VS2006中使用C ++项目来做到这一点.我现在试图在VS2010上的ASP.NET解决方案上做同样的事情,但不知道如何做.如果此功能消失了,似乎对我来说倒退了一步.

帕特里克

Hi,

Does anyone know if it is possible to set the same setting across multiple projects in a solution (e.g. if I wanted to remove the TRACE symbol from several projects at the same time).

I used to do this using C++ projects in VS2006. I am now trying to do the same thing in VS2010 on an ASP.NET solution and can''t figure out how to do it. Seems like a step backwards to me if this functionality has gone.

Kind wishes, Patrick

推荐答案

,当您定义自定义配置节时,请将其configSource设置为一个外部文件(whatever.config).该外部文件应添加到SOLUTION中,而不是项目中.它会出现在解决方案项目"下.在每个项目中,添加一个现有文件,浏览到what.config,单击添加"按钮上的下拉列表,然后选择添加为链接".

Whatever.config将是一个文件,您可以在解决方案项目"下编辑该文件,然后在编译时将其复制到每个应用程序中.
When you define your custom configuration section, set its configSource to an external file (whatever.config). This external file should be added to the SOLUTION and not the project. It will appear under "Solution Items". In each project, Add an Existing File, browse to whatever.config, click the dropdown on the Add button and select "Add as Link."

Whatever.config will be a single file you can edit under Solution Items, and it gets copied into each application at compile time.


作为替代,Jeremy在其博客中写道: http://blogs.msdn.com/b/jjameson/archive/2009/04/02/linked-files-in-visual-studio-solutions.aspx [
As an alternative, Jeremy wrote in his blog at: http://blogs.msdn.com/b/jjameson/archive/2009/04/02/linked-files-in-visual-studio-solutions.aspx[^]


这篇关于在解决方案中跨多个项目设置项目设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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