Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want the commandline for building a particular project of a solution using msbuild like we do with devenv.com.In devenv.com we can specify a project of a solution using following commandline

devenv.com /Build Release|x86 test.sln /project "testproject"

Using the above commandline i can build the testproject in the test.sln using devenv.com.What is the commandline for msbuild for the same solution.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

msbuild test.sln /t:project /p:Configuration="Release" /p:Platform="x86" /p:BuildProjectReferences=false

Notice that what is assigned to /t is the project name in the solution, it can be different from the project file name.

Also, as stated in How to: Build specific targets in solutions by using MSBuild.exe:

If the project name contains any of the characters %, $, @, ;, ., (, ), or ', replace them with an _ in the specified target name.

You can also build multiple projects at once:

msbuild test.sln /t:project;project2 /p:Configuration="Release" /p:Platform="x86" /p:BuildProjectReferences=false

To rebuild or clean, change /t:project to /t:project:clean or /t:project:rebuild


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...