HostFXR should service hostpolicy targeted by the app
When HostFXR needs to lookup the serviced version of hostpolicy, it currently looks it up using the version/name info that was baked into it at compile-time, since it is updated in lock-step with hostpolicy.dll.
This will not work when we will need to publish a new hostfxr (which has a different version) that needs to work with existing SharedFX and load a serviced version of hostpolicy corresponding to the FX.
CC @piotrpMSFT @brthor
@gkhanna79 Does my recent exception working with a test shared framework app pertain to this issue?
Error loading hostpolicy 1.0.1-rc2-002296; interface mismatch between hostpolicy [32771]
and hostfxr [120] Specifically, the structure of corehost_init_t has changed, do not know
how to interpret it
Can you try this workaround? https://github.com/dotnet/cli/issues/2389
Could you please try removing 1.0.1-rc2-002296 and target the newer FX?
@schellap Ok, but that host policy is being pulled in :sparkles: auto-magically :sparkles:
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-*"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [ "dnxcore50", "portable-net451+win8" ]
}
},
.NET Command Line Tools (1.0.0-rc2-002363)
Product Information:
Version: 1.0.0-rc2-002363
Commit Sha: 065e8352fc
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
Perhaps, I should wait for -2392 and see if this issue clears up??
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-002363"
}
The "version" field should be shared FX that you just installed.
dir C:\Program Files\dotnet\shared\Microsoft.NETCore.App\
Can you point me to what your runtimeconfig.json contains in the bin drop cotnains?
@schellap Ok, thanks.
testshared.runtimeconfig.json
{
"runtimeOptions": {
"framework": {
"name": "Microsoft.NETCore.App",
"version": "1.0.0-rc2-23931"
}
}
}
dir C:\Program Files\dotnet\shared\Microsoft.NETCore.App\
or which dotnet relative dir?
Can you target 1.0.0-rc2-3002363?
I can, but I have the Azure VM deprovisioned, so I can't run the same test I ran earlier. I was planning on spinning it back up to test again in the morning. I can post back if you like with the result of the change to the TFM you provided tomorrow.
The runtimeconfig.json will then be updated with this version and the host should pick it up and load the compatible hostpolicy.dll.
@schellap Is the way I specified Microsoft.NETCore.App initially (-*) incorrect? ... or is this something that will just not happen shortly with updates?
@GuardRex do you have a global.json in an ancestor of your working dir? Basically, it seems from the dotnet that got picked up, you have 1.0.0-rc2-002363, but do you have an global.json override?
From this:
.NET Command Line Tools (1.0.0-rc2-002363)
Product Information:
Version: 1.0.0-rc2-002363
Commit Sha: 065e8352fc
No, I'm not using a global.json with any of my apps, including this test app.
When I did a restore with 1.0.0-*:
I got this error. May be they should make it red in color or something.
error: Unable to resolve 'Microsoft.NETCore.App (>= 1.0.0)' for '.NETCoreApp,Version=v1.0'.
Not happening here ...
log : Restoring packages for c:\_APPLICATIONS\testshared\project.json...
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/microsoft.aspnetcore.diagnostics/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.diagnostics/index.json
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/microsoft.aspnetcore.server.iisintegration/index.json
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration/index.json
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/microsoft.extensions.logging.console/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.console/index.json
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/microsoft.aspnetcore.staticfiles/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.staticfiles/index.json
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/microsoft.aspnetcore.mvc/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc/index.json
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/system.security.cryptography.algorithms/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/system.security.cryptography.algorithms/index.json
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/system.security.cryptography.x509certificates/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/system.security.cryptography.x509certificates/index.json
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/microsoft.aspnetcore.server.kestrel/index.json
info : CACHE https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.kestrel/index.json
info : NotFound https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.server.iisintegration/index.json 231ms
info : CACHE https://myget-2e16.kxcdn.com/artifacts/aspnetcidev/nuget/v3/flatcontainer/microsoft.netcore.app/index.json
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.netcore.app/index.json
info : NotFound https://api.nuget.org/v3-flatcontainer/microsoft.netcore.app/index.json 242ms
info : Committing restore...
log : Writing lock file to disk. Path: c:\_APPLICATIONS\testshared\project.lock.json
log : c:\_APPLICATIONS\testshared\project.json
log : Restore completed in 2860ms.
NuGet Config files used:
c:\_APPLICATIONS\testshared\NuGet.Config
C:\Users\XXXXX\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
https://www.myget.org/F/aspnetcidev/api/v3/index.json
https://api.nuget.org/v3/index.json
Why do I have a feeling I found another one??? :imp:
md temp & cd temp
dotnet new
dotnet restore
Now change the project.json and do a restore?