Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to do Visual Studio "project only" build from command line?

devenv mysolution.sln /build "Release|Win32" /project myproject

When building from the command line, it seems I have the option of doing a /build or /rebuild, but no way of saying I want to do "project only" (i.e. not build or rebuild the specified project's dependencies as well). Does anyone know of a way?

like image 457
Owen Avatar asked Sep 23 '08 20:09

Owen


People also ask

How do I compile only in Visual Studio?

Ctrl+F7 will compile only the active source file. Look for the Compile item at the bottom of the Build menu. Of course, you'll still have to do a build before you can test, but if you just want a quick sanity check after modifying a source file, this can be handy.

How do you prepare only one project in a solution?

To build a specific target of a specific project in a solution. At the command line, type MSBuild.exe <SolutionName>. sln , where <SolutionName> corresponds to the file name of the solution that contains the target that you want to execute.

What is the difference between build rebuild and clean in Visual Studio?

Clean Solution - deletes all compiled files (all dll's and exe's ). Build Solution - compiles code files (dll and exe) that have changed. Rebuild Solution - Deletes all compiled files and Compiles them again regardless of whether or not the code has changed.


2 Answers

Depending on the structure of your build system, this may be what you're looking for:

msbuild /p:BuildProjectReferences=false project.proj
like image 79
Derek Slager Avatar answered Oct 21 '22 14:10

Derek Slager


MSBuild is what you want

MSBuild.exe MyProject.proj /t:build
like image 38
Xian Avatar answered Oct 21 '22 14:10

Xian