mmutilva mmutilva - 1 month ago 7
C# Question

Build only one project in a solution from command line

I have a solution with lots of solution folders with lots of c# projects inside them.

How do I build/rebuild only one of those projects from command line?

I guess there's some way to do it using

msbuild
but I don't know anything about msbuild.

Thanks!

Answer

You can simply call msbuild and pass it the .csproj/.vbproj project file that you want to build, and it will do only that one.

So something like:

cd \MySolution
msbuild .\Project1\Project1.csproj