在 VS 2010 中管理项目配置
我正在 VS2010 中开发一个包含多个项目(类库、互操作、Web 应用程序等)的解决方案。
对于 Web 应用程序,我想利用 VS2010 中的配置转换,因此我一度为每个环境添加了配置:开发、测试、生产等。
一段时间后,在重新排列项目布局后,我注意到有些项目在属性页面下拉列表中显示了所有配置。一些项目(自从我进行该设置后添加)仅显示标准的调试和调试。发布配置。当我意识到这会使构建配置变得更糟而不是更好时,我决定删除我添加的所有额外配置。
我已从解决方案中删除了所有各种配置选项,但具有备用配置选项的项目仍然具有它们,并且我不知道如何在各个项目中删除它们。
另外,现在我发现并非所有项目都必须具有相同的配置,我想在解决方案级别和 Web 应用程序项目(用于配置转换)中创建环境配置,但保留所有类库具有基本的调试/发布配置。我无法在用户界面中找到任何工具,也无法在网络上找到有关如何设置此类内容的任何信息。
那么,简而言之,在 VS2010 中管理项目级别配置的最佳/最简单方法是什么?
I'm working on a solution with multiple projects (class libraries, interop, web application, etc) in VS2010.
For the web application, I would like to take advantage of the config transformations in VS2010, so at one point I added configurations for each of our environments: Development, Test, Production, and so on.
Some time later, after having rearranged the project layout, I noticed that some projects show all of the configurations in the properties page dropdown. Some projects (added since I did that setup) show only the standard Debug & Release configurations. Once I realized that this was going to make build configurations worse, not better, I decided to remove all of the extra configurations I had added.
I've removed all of the various configuration options from the solution, but the projects that had the alternate configuration options still have them, and I can't figure out how to get rid of them in individual projects.
Also, now that I see that not all projects have to have the same configurations, I would like to create my environmental configurations at the solution level, and in the web application project (for the config transforms), but leave all of the class libraries with the basic Debug/Release configurations. I've been unable to find any tool in the UI, or any information on the 'Net, concerning how to set up such a thing.
So, in short, what's the best/easiest way to manage configurations at the project level in VS2010?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在配置管理器屏幕的顶部,您将看到解决方案配置和解决方案平台。每个解决方案配置本质上都是一组项目配置。
不存在“全局一切”配置,因为不同的技术有不同的配置选项。例如,如何将 C# 项目的配置映射到 C++ 项目?这就是为什么配置是在项目级别定义和维护的。
正确的做法就是您正在做的事情。将新项目添加到解决方案的管理开销之一是将这些项目配置复制到新项目中,然后通过配置管理器屏幕在解决方案配置中进行适当的配置。
为了解决您的具体问题,您可以从配置管理器中删除现有的项目配置。在要修改的项目上,单击“配置”下拉列表,选择“编辑”,然后在“编辑项目配置”对话框中,选择要删除的配置,然后单击“删除”按钮。
In the configuration manager screen, at the top, you'll see the solution configuration and solution platform. Each solution configuration is essentially a set of project configurations.
There is no "global everything" configuration because different technologies have different configuration options. How do you map a C# project's configuration to a C++ project, e.g.? This is why configurations are defined and maintained at the project level.
The right way to do it then is what you were doing. One of the administrative overheads of adding a new project to your solution is copying those project configurations in the new project and then configuring it appropriately in the solution configurations via the Configuration Manager screen.
To address your specific question, you can remove an existing project configuration from the Configuration Manager. On the project you want to modify, click the Configuration drop down, select Edit, and in the "Edit Project Configurations" dialog, select the configuration you want to remove and then click the "Remove" button.
您可以通过“配置管理器”对话框执行所有操作,该对话框可通过 Visual Studio 的主菜单通过“构建”>“访问”进行访问。配置管理器...
另请参阅如何:创建和编辑配置
You can do everything from the Configuration Manager dialog, accessed from Visual Studio's main menu via Build > Configuration Manager...
See also How to: Create and Edit Configurations