Ioan-Alexandru Tataru
Ioan-Alexandru Tataru

Reputation: 11

Build using specified startup project

I am running the build command like this:

set MSBuildParams=/m:16 /target:Rebuild /property:Configuration=""Release"";Platform=""x64"" msbuild %MSBuildParams% C:\path\to\the\sln\Solution.sln

I'm using the following msbuild version: Microsoft (R) Build Engine version 14.0.25420.1

Solution.sln contains 2 projects,

Is there a way to do that, without changing the Solution.sln? What would be the best practice to accomplish that?

Upvotes: 1

Views: 2052

Answers (1)

Leo Liu
Leo Liu

Reputation: 76760

You could use the specific command line to build/rebuild the specific project using MSbuild like the following case.

specify project file of a solution using msbuild

But we have to change certain files if you want to change the start up project without using the VS IDE, since the setting was stored into the ".SUO" file.

Actually there is no setting in ".SLN" file for startup project even if you don't want to change it,

In addition, the start up project was the running project of the solution, maybe you don't have to change it:

https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/b6347dce-8449-4cbb-a606-7b19407a1026/how-do-i-set-the-startup-project-in-the-sln-file?forum=vcgeneral

Upvotes: 1

Related Questions