Fix loading of rollback installed workloads in Visual Studio #39901
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.
Description
With PR #37681 , we introduced a new code path that will load System.Text.Json in framework and core versions of the .NET SDK. This code path triggers when installing SDK workloads using rollback files. While this scenario is not broadly documented, it is the default for all dogfooders of Aspire workloads as a script is used to install specific versions of the workloads.
We don't reference S.T.J in the framework version of the msbuildsdkresolver. However, it transitively pulls in a 7.0 version of that package through another dependency. Because of transitive pinning, this gets hoisted to version 8.0.2 which VS does not have.
This is fine in the .net core SDK but breaks VS.
Customer Impact
Any customer installing workloads from a rollback file will have their workload templates be broken and get errors when doing file new on any project.
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2013426
Regression
Yes,
Risk
Low - we have similar pinned package versions in other framework assemblies for this specific reason.
Testing
Jose tested manually copying the newly built files over the old ones that he was unblocked with no errors and valid templates showing up.