在 VS 2010 中管理项目配置

发布于 2024-09-04 21:23:16 字数 491 浏览 6 评论 0原文

我正在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

没︽人懂的悲伤 2024-09-11 21:23:16

在配置管理器屏幕的顶部,您将看到解决方案配置和解决方案平台。每个解决方案配置本质上都是一组项目配置。

不存在“全局一切”配置,因为不同的技术有不同的配置选项。例如,如何将 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.

遥远的她 2024-09-11 21:23:16

您可以通过“配置管理器”对话框执行所有操作,该对话框可通过 Visual Studio 的主菜单通过“构建”>“访问”进行访问。配置管理器...

  • 要从各个项目中删除配置,请选择该项目并打开“配置”列中的下拉列表,然后单击 。
  • 要选择要为新解决方案配置构建的配置,请激活该解决方案配置,然后选择要为每个项目构建的配置。

另请参阅如何:创建和编辑配置

You can do everything from the Configuration Manager dialog, accessed from Visual Studio's main menu via Build > Configuration Manager...

  • To remove configurations from your individual projects, select the project and open the drop down list in the "Configuration" column, then click .
  • To select the configurations to build for a new solution configuration, make the solution configuration active, then select the configuration to build for each project.

See also How to: Create and Edit Configurations

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文