命令 BuildOnlyProject 已禁用
我已将命令 BuildOnlyProject 添加到菜单中。但它始终处于禁用状态。当我在解决方案资源管理器中选择项目节点时,它也会被禁用。 有人知道为什么吗?
谢谢并致以最诚挚的问候,托马斯
I have added the command BuildOnlyProject to the Menu. But it is always disabled. It is also disabled, when I select a Project-Node in the Solutionexplorer.
Does someone know why?
Thanks and best regards, Thomas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Visual Studio 不支持仅针对 C# 或 Visual Basic 项目生成项目,仅支持 C++ 项目。如果您有一个包含 C# 和 C++ 项目的混合解决方案,您可以在解决方案资源管理器中选择一个 C++ 项目,您将看到:
仅在菜单中 。使用此菜单选项实际上只会构建一个项目,如输出窗口所示。另一方面,如果您选择 C# 项目,“仅项目”子菜单将消失,构建项目的唯一方法将是:
当您使用此菜单选项时,所选项目以及该项目依赖的任何其他项目也将被构建,通常是总共几个项目。
这就是为什么如果您选择的项目不是 C++ 项目,“仅构建项目”命令将被禁用。
Visual Studio does not support project only builds for C# or Visual Basic projects, only for C++ projects. If you have a mixed solution with both C# and C++ projects in it you can select a C++ project in the Solution Explorer and you will see:
in the menu. Using this menu option will literally cause just a single project to be built as demonstrated by the output window. On the other hand, if you select a C# project, the "Project Only" sub-menu will be gone and the only way to build the project will be with:
When you use this menu option the selected project and any other projects that the project depends on will also be built, often several projects in all.
This is why if you select a project that is not a C++ project the "Build Only Project" command will be disabled.
您希望发生与命令
Build.BuildSelection
不同的事情吗?似乎Build.BuildProjectOnly
不起作用,MS 似乎暗示 人们想要的是构建。构建选择。Do you want anything to happen that would be different from the command
Build.BuildSelection
? It seems thatBuild.BuildProjectOnly
does not work, and MS seems to imply that what people want is Build.BuildSelection.如果您想弄脏,为什么不向您的项目添加一种特殊的构建配置,该配置仅包含您想要构建的一个项目
只有选定的项目才会被构建。
If you want to get dirty why not add a special build configuration to your project which only includes the one project you want to build
only the selected projects will be build.
MSBuild 检查名为 BuildProjectReferences 的属性。因此,如果您手动运行 MSBuild,您可以发出:
MSBuild checks for a property called BuildProjectReferences. So if you're running MSBuild manually, you can issue: