Given the solution file with the projects in it, and you want to build / rebuild one project.
This MSDN webpage lists exactly what you need to do:
http://msdn.microsoft.com/en-us/library/ms171486.aspx
So, the given mysolution.sln solution file with projects:
- foo.vcxproj
- bar.vcxproj
- baz.vcxproj
where they all depend on each other in the lower and upper order. So baz is the most independent, bar depends on baz and foo depends on bar .
If you want to build foo, then you do:
MSBuild mysolution.sln /target:foo
Other answers here did not account for dependencies. Of course, msbuild.exe will build one project file (i.e. Foo.vcxproj), but it will not work if the bar and the base have not been built yet. To build several projects and first create independent projects, you need to transfer the solution to the file (after the OP mentioned that it is part of the solution file). Then pass the project name and the target, separated by a colon.
MSBuild mysolution.sln /target:foo:Rebuild
Great guess here. I assume that the project name $ (project_name) matches the project name.
Edit (from comment ) . If there are periods (.) In the project name, you will need to replace them with an underscore (_).
C Johnson May 23 '13 at 17:33 2013-05-23 17:33
source share