Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild.exe closing

Apparently MSBuild.exe stays active after a build in VS2017 is aborted. I found that I should use MSBUILDDISABLENODEREUSE=1 as an environmental variable to tell VS2017 to close the MSBuild.exe instance. Yet I cannot seem to find where I should enter this variable. Could anybody tell me in detail? I'm quite new to programming / VS2017.

like image 625
Bart Pinnock Avatar asked Nov 28 '17 15:11

Bart Pinnock


1 Answers

Could anybody tell me in detail?

This is by design, since MSBuild 3.5. The child processes persist until 15 minutes has passed without use (ie without a build). This gives some performance gains in some cases. It's quite possible to disable it.

Related issues filed on MSConnect: MSbuild proliferate.

You can do this by setting and environment variable and/or msbuild arguments.

Detailed steps set environment variable:

To set the “MSBuildDisableNodeReuse” variable globally use the “Environment Variables” property page, which is accessed by right-clicking Computer, clicking Properties, and clicking the “Environment Variables” button under the “System Properties” dialog window Advanced tab:

enter image description here

Detailed step to set msbuild arguments:

msbuild YourApp.sln /nr:false /t:rebuild

See Prepare the Development Environment for more detailed info.

Hope this helps.

like image 143
Leo Liu-MSFT Avatar answered Sep 19 '22 01:09

Leo Liu-MSFT