You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace MSBUILD_NODEREUSE_ENABLED env var with a switch (allow node reuse on CI) #17013
The VMR (dotnet/dotnet) added an opt-in to allow MSBuild node reuse on CI (which is otherwise forced off). It is implemented as an environment variable, MSBUILD_NODEREUSE_ENABLED, mirroring the existing MSBUILD_MT_ENABLED (-mt) pattern:
repo-projects/Directory.Build.props sets MSBUILD_NODEREUSE_ENABLED=1 when /p:DotNetBuildNodeReuse=true is passed.
The Arcade eng/commonbuild / msbuild / tools scripts only force nodeReuse=false on CI when MSBUILD_NODEREUSE_ENABLED != 1, and gate the "Node reuse must be disabled in CI build" guard the same way.
Per Arcade convention, the controls in eng/common/tools.ps1 / tools.sh (and build.* / msbuild.*) are switch-based parameters, not environment variables. nodeReuse itself is already a switch (-nodeReuse / --nodeReuse). Using a magic env var to override it is inconsistent and less discoverable. The Arcade team owns these entry points.
Ask
Replace the MSBUILD_NODEREUSE_ENABLED env-var check in the Arcade eng/common scripts with a proper switch (e.g. -allowNodeReuseOnCI / --allow-node-reuse-on-ci) that:
prevents the CI override that forces nodeReuse=false, and
suppresses the "Node reuse must be disabled in CI build" guard in MSBuild-Core,
allowing the existing -nodeReuse switch to take effect on CI. The VMR would then pass that switch (from Directory.Build.props) instead of setting the env var.
Notes
The current env-var approach is intentionally marked "internal testing only" in the VMR and is not meant to be a permanent blessed mechanism.
Worth deciding whether a permanent, supported way to bypass the no-node-reuse-on-CI guard is desirable at all (that guard exists for determinism / stale tasks / locked-file reasons).
The standard eng/common build script are already msbuild focused. Any additional passed in argument gets automatically appended to the msbuild process invocation:
Therefore, I don't think that we even need new parameters for these kind of features. Whenever we introduce a new msbuild parameter I would do the following:
Pass the new switch to the build.ps1 / build.sh invocation in the repos (i.e. from the VMR)
Repos that have custom build.ps1 / build.sh scripts and don't auto-forward parameters to msbuild, either define a parameter for that new feature or even better introduce something like a msbuildParameters switch once so that we don't have to repeat this again and again. IIRC repos affected that are part of the VMR are aspnetcore, fsharp, roslyn and nuget.
So concretely, I would remove the MSBUILD_NODEREUSE_ENABLED and MSBUILD_MT_ENABLED env vars and replace them with build script invocation parameters.
Activity
Reference arcade follow-up issue in node reuse comments in all 6 scripts
ViktorHofer commentedon Jun 30, 2026
The standard eng/common build script are already msbuild focused. Any additional passed in argument gets automatically appended to the msbuild process invocation:
arcade/eng/common/build.ps1
Line 155 in 2de259d
Therefore, I don't think that we even need new parameters for these kind of features. Whenever we introduce a new msbuild parameter I would do the following:
msbuildParametersswitch once so that we don't have to repeat this again and again. IIRC repos affected that are part of the VMR are aspnetcore, fsharp, roslyn and nuget.So concretely, I would remove the
MSBUILD_NODEREUSE_ENABLEDandMSBUILD_MT_ENABLEDenv vars and replace them with build script invocation parameters.Add -nodeReuse parity and -mt support to msbuild scripts
Merge base branch to resolve conflicts
ViktorHofer commentedon Dec 1, 2026
Closing. I did this a while ago.