1

When executing the solution build as follows, multiple worker nodes are created and the process finishes in 2 mins.

MSBuild.exe path\to.sln /p:OutDir=C:\out\ -m:4 /p:Configuration=QA /p:Platform="Any CPU"

However, when attempting to execute the SLN with specific targets (T1,T2,T3), these are built in series rather than parallel. Only the main msbuild.exe node is created; no workers

MSBuild.exe -target:Deployment\T1 -target:Deployment\T2 -target:Deployment\T3 path\to.sln /p:OutDir=C:\out\ -m:6 /p:Configuration=QA /p:Platform="Any CPU"

Despite the -m:6 parameter, only a single worker node is created; the process takes 2.5* longer to do the same thing.

  • Is there some limitation when specifying targets that prevent them being executed in parallel?
  • Any workarounds?
2
  • I didn't know of a limitation. But why are you specifying the Deployment\T1 target twice? Commented Mar 6, 2019 at 19:12
  • Whoops - copy/paste issue. In my actual command those are project names Commented Mar 6, 2019 at 19:25

1 Answer 1

1

according to my understanding, parallel msbuild is only for "msbuild core tasks". I mean, there is an msbuild basic tasks: restore, build, test etc', and these tasks can run parallel.

But msbuild not try to parallel the targets. In this case, msbuild will run them sequencely.

The targets do for cases like /t:Restore,Build,Test, And it will never happen in parallel.

So, you can say this is limitation.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks - that's what I feared. In the end (for anyone else looking for the solution) I just kicked off 6x simultaneous MSBUILD jobs, 1x per target, which ran in a total of a minute and a half! Fastest way possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.