Allow overriding MSBuildRuntimeType to "Full" on RUNTIME_TYPE_NETCORE #7481
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
We have scenarios in internal build tools where MSBuild evaluation is executed in the parse phase under a .NET 6.0 process, prior the build phase which builds projects using full framework
msbuild.exe
. As evaluation results in the parse phase must match the build phase for prediction to be accurate,MSBuildRuntimeType
must be set to"Full"
in both cases - so we currently solve this by launching a separate process under full framework which runs evaluation / parsing and serializes results back to the main process.However, this serialization incurs a significant amount of overhead on large repos. Instead, by having the option of forcing
MSBuildRuntimeType=Full
when onRUNTIME_TYPE_NETCORE
, we would be able to evaluate these projects in-process for the majority of repos.Changes Made
MsBuildForceEvaluateAsFullFramework
MSBuildRuntimeType="Full"
when this env var is setTesting
Ran multiple validation runs across all repos on internal build tools to validate this approach works, comparing evaluation / parser results of the "forced" runtime vs "actual".