Fallback to VS instance location for ToolLocationHelper.GetPathToReferenceAssemblies
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 133
Description
#627 allowed framework reference assemblies to be installed anywhere and referenced by overriding the property `TargetFrameworkRootPath`. This works great at build time, because MSBuild sees that property set in the project, passes it to the property function `[Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries`, and gets back a correctly-computed path.
Things outside of MSBuild that attempt to use `ToolLocationHelper.GetPathToReferenceAssemblies`, though, don't necessarily have access to the project's `$(TargetFrameworkRootPath)`. That can mean that they fail to find assemblies that could be located at build time. This was noticed when the Reference Manager dialog in VS failed to locate any assemblies from the Xamarin frameworks (even though once added a project could build just fine).
There is a known location in the VS instance for these assemblies, `[VSRoot]\Common7\IDE\ReferenceAssemblies\Microsoft\Framework`. MSBuild could fall back to searching that location automatically, without requiring override of the `TargetFrameworkRootPath` parameter to `GetPathToReferenceAssemblies`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing ToolLocationHelper.GetPathToReferenceAssemblies and its TargetFrameworkRootPath handling, then compare it with the VS instance location at [VSRoot]\Common7\IDE\ReferenceAssemblies\Microsoft\Framework. Done means callers without the project property can find framework reference assemblies installed there, while the existing build-time behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100