visual-studio 从 Configuration Manager 中删除解决方案平台
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2453525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Removing a solution platform from Configuration Manager
提问by demoncodemonkey
I have a solution in VS2008 containing C# and C++/CLI projects. There are 3 "solution platforms" in my solution:
我在 VS2008 中有一个包含 C# 和 C++/CLI 项目的解决方案。我的解决方案中有 3 个“解决方案平台”:
- Any CPU
- Win32
- Mixed Platforms
- 任何 CPU
- Win32
- 混合平台
I never want to "just build the C# ones" or "just build the C++ ones", I always want to build all projects. So the solution platformsmetaphor is meaningless to me, I'll leave it on Mixed Platforms or whatever as long as they all build.
我从不想“只构建 C# 的”或“只构建 C++ 的”,我总是想构建所有项目。所以解决方案平台的比喻对我来说毫无意义,我会把它留在混合平台或其他任何东西上,只要它们都能构建。
Now VS sometimes automatically switches the current solution platform to Any CPU (I'm not sure when or why). This means that pressing F7 will only try to build the C# projects, which is obviously no good. So I have to switch back to Mixed Platforms and try again.
现在 VS 有时会自动将当前解决方案平台切换到 Any CPU(我不确定何时或为什么)。这意味着按 F7 只会尝试构建 C# 项目,这显然没有好处。所以我必须切换回混合平台并重试。
So how to workaround this irritating problem? I have tried 2 ways:
那么如何解决这个恼人的问题呢?我尝试了两种方法:
- In Configuration Manager, remove the Any CPU and Win32 solution platforms. This worked until I added a new project and Visual Studio very kindly added them back in... :/
- In Configuration Manager, check all checkboxes for all projects in all configurations in all solution platforms. This becomes a nightmare to manage with many projects in the solution.
- 在 Configuration Manager 中,删除 Any CPU 和 Win32 解决方案平台。这一直有效,直到我添加了一个新项目并且 Visual Studio 非常友好地将它们添加回...:/
- 在 Configuration Manager 中,选中所有解决方案平台中所有配置中所有项目的所有复选框。这成为管理解决方案中许多项目的噩梦。
Any other ideas?
还有其他想法吗?
回答by schoetbi
See the msdn:
见msdn:
http://msdn.microsoft.com/en-us/library/ms165408.aspx
http://msdn.microsoft.com/en-us/library/ms165408.aspx
Removing a Platform If you realize that you have no need for a platform, you can remove it using the Configuration Manager dialog box. This will remove all solution and project settings that you configured for that combination of configuration and target. To remove a platform
- On the Build menu, click Configuration Manager.
- In the Active solution platform box, select <Edit>. The Edit Solution Platforms dialog box opens.
- Click the platform you want to remove, and click Remove.
删除平台 如果您意识到不需要平台,可以使用“配置管理器”对话框删除它。这将删除您为该配置和目标组合配置的所有解决方案和项目设置。移除平台
- 在构建菜单上,单击配置管理器。
- 在活动解决方案平台框中,选择 <编辑>。“编辑解决方案平台”对话框打开。
- 单击要删除的平台,然后单击“删除”。
回答by Pekka Lehtikoski
At least on Visual Studio 2005: After removing it from configuration manager, it is also necessary to edit .vcproj as text file and remove any references to Platform manually.
至少在 Visual Studio 2005 上:从配置管理器中删除它后,还需要将 .vcproj 编辑为文本文件并手动删除对平台的任何引用。

