Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command BuildOnlyProject disabled

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

like image 368
BennoDual Avatar asked Apr 17 '11 13:04

BennoDual


3 Answers

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:

  • Build -> Project Only -> Build Only CPlusPlusProjectName

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:

  • Build -> Build CSharpProjectName

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.

like image 56
Rick Sladkey Avatar answered Sep 18 '22 23:09

Rick Sladkey


Do you want anything to happen that would be different from the command Build.BuildSelection? It seems that Build.BuildProjectOnly does not work, and MS seems to imply that what people want is Build.BuildSelection.

like image 23
Kirk Woll Avatar answered Sep 19 '22 23:09

Kirk Woll


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

Project configuration

only the selected projects will be build.

like image 24
Martin Avatar answered Sep 19 '22 23:09

Martin