Fix 9150 --- #i nuget on desktop witout net48 ref assemblies fails. #10114
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.
This PR fixes #10114
FSI uses reference assemblies for compilation purposes the same as the compiler, and relied on the built in msbuild resolver to find them. This had the disadvantage of requiring the developer to install them when using the desktop version of fsi.
Visual Studio dwfault install for the Managed Code workflow, causes the net472 reference assemblies to be loaded. So for any developer who goes for a clean install of VS, will have some trouble when using #r "nuget:blah" from the desktop fsi.
The best fix is to use the : Microsoft.NETFramework.ReferenceAssemblies package, because that will cause the nuget package manager to find the best reference assemblies for the build.
Which is what this change does, when using #r "nuget: we ensure that we go fetch the
Microsoft.NETFramework.ReferenceAssemblies package only when the targetframeworkidentity is .NETFramework.
We also disallow Microsoft.NETFramework.ReferenceAssemblies as a valid user supplied package, to stop developers innovating and perhaps causing problems.
Kevin