CLI uses typeof(object).GetTypeInfo().Assembly.Location to determine FX location
If CoreCLR gets serviced, mscorlib's path will be in the servicing root and not the actual FX location.
Steps to reproduce
copy /y %USERPROFILE%\.nuget\packages\runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR\[Matching CLI Version]\ "C:\Program Files (x86)\dotnetextensions\pkgs\runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR\[Matching CLI Version]\"
dotnet publish
Expected behavior
FX dir determination should be derived from property APP_CONTEXT_DEPS_FILES and path containing Microsoft.NETCore.App.deps.json. See:
https://github.com/dotnet/cli/blob/803fef6a8b4838afd0e5f77e9e342d3e616d6c96/src/Microsoft.Extensions.DependencyModel/DependencyContextLoader.cs#L156
Actual behavior
https://github.com/dotnet/cli/blob/ac4c6702d5d345dc9c397f80290f105fedebe98b/src/Microsoft.DotNet.Cli.Utils/Muxer.cs#L38
Environment data
dotnet --info output:
@brthor @piotrpMSFT @Sridhar-MS @gkhanna79
@piotrpMSFT , who should pick this one up?
I can pick this one...
This would require host change to plumb the fx dir.
I believe there are two changes required:
- Add the FX dir to AppContext - @schellap Please file an issue to fi this.
- Plumb the CLI to consume the FX dir - which is this issue. @brthor Should look into this.
Once we have this in AppContext, this should be a one line change:
https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.DotNet.Cli.Utils/CoreHost.cs#L31
I believe @sokket was picking this one up?
No issues guys, I'll make the fix.
Filed https://github.com/dotnet/cli/issues/2558 against @schellap
This change needs to account for a number of codepaths
- [ ] Muxer.cs
- [ ] CoreHost.cs
@schellap told me today he'll be picking this up to test the CoreHost/Dotnet.exe changes. @schellap will you be doing this?
Fixed by dotnet/cli#2617