BuildOnlyProject Command Disabled

I added the BuildOnlyProject command to the menu. But he is always disconnected. It also turns off when I select Project-Node in Solutionexplorer. Does anyone know why?

Thanks and best regards, Thomas

+6
source share
4 answers

Visual Studio does not support building projects only for C # or Visual Basic projects, only for C ++ projects. If you have a mixed solution with C # and C ++ projects, you can select the C ++ project in the solution explorer and you will see:

  • Build → Only project → Build only CPlusPlusProjectName

on the menu. Using this menu option will literally lead to the creation of only one project, as shown in the output window. On the other hand, if you select a C # project, the "Project Only" submenu will disappear, and the only way to build a project would be:

  • Assembly -> Assembly CSharpProjectName

When you use this menu item, the selected project and any other projects depending on the project, and often several projects, will also be created.

That's why if you select a project that is not a C ++ project, the Build Only Project command will be disabled.

+6
source

Do you want something to happen that would be different than the Build.BuildSelection command? It seems that Build.BuildProjectOnly not working , and MS seems to imply that what people want is Build.BuildSelection .

+4
source

If you want to get dirty, why not add to the project a special build configuration that includes only one project that you want to build

Project configuration

only selected projects will be created.

+2
source

MSBuild checks the BuildProjectReferences property . Therefore, if you use MSBuild manually, you can specify:

 MSBuild.exe My.Project.csproj /p:BuildProjectReferences=false 
+1
source

Source: https://habr.com/ru/post/886084/


All Articles