Revert Assembly Loading Performance Changes #6423
Merged
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.
Summary
When multiple versions of
NuGet.Frameworks.dllget loaded, the first one wins. Since MSBuild depends on this DLL, it means that if someone else loads the DLL first and it doesn't match the version that MSBuild carries, then this breaks MSBuild. The original change was made to improve performance by reducing jitting from the Nuget* DLLs, but it seems that the compatibility tail is too high.This change reverts the assembly loading behavior to its previous state. We can reevaluate options for SDK 6.0.
Fixes #6377.
Customer Impact
MSBuild API consumers that use NuGet references fail. This includes all users of
Microsoft.NET.Test.Sdk.Regression?
Yes. Worked in 16.9, regressed in 16.10 with #6126.
Testing
Manual patching of SDK works with repro project; reversion to prior behavior.
Risk
Low. Reversion to prior behavior.