Can't load Microsoft.AspNetCore.Hosting 1.1.0.0
See original GitHub issueIn the course of trying to help the EF Core team verify that a bug I’d run across was fixed in v1.1, I updated a functioning solution to both EF Core 1.1 and AspNet Core 1.1.
And I really, really, wish I hadn’t.
First off, my previously-functioning MVC6 site stopped working, complaining about a version mismatch on Microsoft.Logging.Abstractions (I think it involved not being able to find v1.0.0 of that assembly).
So I figured I’d just revert everything back to where it was before I did the test for the EF Core team. That should fix everything, right?
Wrong.
Now I’m getting the following:
System.IO.FileLoadException was unhandled Message: An unhandled exception of type ‘System.IO.FileLoadException’ occurred in Unknown Module. Additional information: Could not load file or assembly ‘Microsoft.AspNetCore.Hosting, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Here’s the project.json file for the MVC6 app:
{
"userSecretsId": "aspnet-ConnellCampaigns-ddb1a50a-eba1-4870-91d4-4d26457f64ce",
"dependencies": {
"AutoMapper": "5.1.1",
"BundlerMinifier.Core": "2.2.296",
"ConnellData": "1.0.0-*",
"ConnellDataCore": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Azure.WebJobs": "1.1.2",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.Extensions.Caching.Memory": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.WindowsAzure.ConfigurationManager": "3.2.3",
"Serilog": "2.3.0",
"Serilog.Extensions.Logging": "1.2.0",
"Serilog.Sinks.Literate": "2.0.0",
"Serilog.Sinks.RollingFile": "3.2.0",
"UploadFramework": "1.0.0-*",
"WindowsAzure.Storage": "7.2.1"
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8"
]
}
},
"frameworks": {
"net46": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
},
"dependencies": {
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
I’d appreciate help in getting me back to my paying work 😃. Also advice on how to diagnose this kind of problem in the future (other than never, ever, ever offering to test things 😃).
Issue Analytics
- State:
- Created 7 years ago
- Comments:22 (4 by maintainers)
You might have stray binaries \ app.config in your bin directory. Does wiping the bin directory and rebuilding work?
I had the similar problem for Microsoft.AspNetCore.Http.Features package and I fixed it by adding assembly redirect into app.config:
Alternatively I resolved this problem by removing Microsoft.VisualStudio.Web.BrowserLink.Loader v14.1.0 package (which depends on Microsoft.AspNetCore.Http.Features). But I didn’t want that since I want browser link feature.