runtime: Don't assume dotnet.exe is the only host
It seems that the logic in hostfxr.dll assumes dotnet.exe is the process that is activating it. I’m trying to launch the .NET Core host from a native IIS module and I can’t exactly replicate the lookup behavior because it assumes the initial search path is the executing process instead of the hive where hostfxr.dll is loaded from:
--- Invoked hostfxr [commit hash: 40c565230930ead58a50719c0ec799df77bddee9] main
Own dll path 'C:\Program Files\IIS Express\iisexpress.dll'
Checking if CoreCLR path exists=[C:\Program Files\IIS Express\coreclr.dll]
--- Executing in muxer mode...
Detected a non-standalone application, expecting app.dll to execute.
Treating application 'C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.dll' as a managed executable.
App runtimeconfig.json from [C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.dll]
Runtime config is cfg=C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.runtimeconfig.json dev=C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.runtimeconfig.dev.json
Attempting to read runtime config: C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.runtimeconfig.json
Attempting to read dev runtime config: C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.runtimeconfig.dev.json
Runtime config [C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.runtimeconfig.json] is valid=[1]
Ignoring host interpreted additional probing path C:\Users\dfowler\.dotnet\store\x64\netcoreapp2.0 as it does not exist.
--- Resolving FX directory, specified ''
Searching FX directory in [C:\Program Files\IIS Express\]
Attempting FX roll forward starting from [2.0.0]
Applying patch roll forward from [2.0.0]
Searching FX directory in [C:\Program Files\dotnet]
Attempting FX roll forward starting from [2.0.0]
Applying patch roll forward from [2.0.0]
Inspecting version... [1.0.5]
Inspecting version... [1.1.2]
Inspecting version... [2.0.0-preview1-002111-00]
Inspecting version... [2.0.0-preview2-25407-01]
It was not possible to find any compatible framework version
Executing as a portable app as per config file [C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\SampleServer.runtimeconfig.json]
--- Resolving hostpolicy.dll version from deps json [Microsoft.NETCore.App.deps.json]
Dependency manifest [Microsoft.NETCore.App.deps.json] does not exist
The specified framework 'Microsoft.NETCore.App', version '2.0.0' was not found.
- Check application dependencies and target a framework version installed at:
\
- Alternatively, install the framework version '2.0.0'.
Versus running from the command line:
--- Invoked hostfxr [commit hash: e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d] main
Own dll path 'C:\Users\dfowler\.dotnet\x64\dotnet.dll'
Checking if CoreCLR path exists=[C:\Users\dfowler\.dotnet\x64\coreclr.dll]
--- Executing in muxer mode...
Detected a non-standalone application, expecting app.dll to execute.
Treating application 'C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\
mpleServer.dll' as a managed executable.
App runtimeconfig.json from [C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcore
p2.0\SampleServer.dll]
Runtime config is cfg=C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\
mpleServer.runtimeconfig.json dev=C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\ne
oreapp2.0\SampleServer.runtimeconfig.dev.json
Attempting to read runtime config: C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\n
coreapp2.0\SampleServer.runtimeconfig.json
Attempting to read dev runtime config: C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Deb
\netcoreapp2.0\SampleServer.runtimeconfig.dev.json
Runtime config [C:\Users\dfowler\Documents\GitHub\AspNetCoreModule\samples\SampleServer\bin\Debug\netcoreapp2.0\Sample
rver.runtimeconfig.json] is valid=[1]
Ignoring host interpreted additional probing path C:\Users\dfowler\.dotnet\store\x64\netcoreapp2.0 as it does not exis
--- Resolving FX directory, specified ''
Searching FX directory in [C:\Users\dfowler\.dotnet\x64\]
Attempting FX roll forward starting from [2.0.0]
Applying patch roll forward from [2.0.0]
Inspecting version... [1.0.5]
Inspecting version... [1.1.2]
Inspecting version... [2.0.0]
Inspecting version... [2.0.0-preview2-25407-01]
Inspecting version... [2.0.0-preview3-25413-01]
Inspecting version... [2.0.0-preview3-25426-01]
Inspecting version... [2.0.0-preview3-25427-02]
Inspecting version... [2.0.0-preview3-25428-01]
Inspecting version... [2.0.0-preview3-25502-01]
Inspecting version... [2.0.0-preview3-25510-01]
Inspecting version... [2.0.0-preview3-25516-01]
Inspecting version... [2.0.0-preview3-25518-01]
Attempting FX roll forward starting from [2.0.0]
Applying patch roll forward from [2.0.0]
Inspecting version... [2.0.0]
Inspecting version... [-1.-1.-1]
Changing Selected FX version from [] to [C:\Users\dfowler\.dotnet\x64\shared\Microsoft.NETCore.App\2.0.0]
Searching FX directory in [C:\Program Files\dotnet]
Attempting FX roll forward starting from [2.0.0]
Applying patch roll forward from [2.0.0]
Inspecting version... [1.0.5]
Inspecting version... [1.1.2]
Inspecting version... [2.0.0-preview1-002111-00]
Inspecting version... [2.0.0-preview2-25407-01]
Chose FX version [C:\Users\dfowler\.dotnet\x64\shared\Microsoft.NETCore.App\2.0.0]
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (17 by maintainers)
Note the current code in the PR requires a filename, so
dotnet.exe
should be appended to the path.I’m assuming its just this. @muratg @davidfowl @jkotalik can you confirm?