AspNetCore Abstractions could not load

9

I use ASP.NET Core + Angular 2 template for Visual Studio. I have updated my project.json file and it looks now (part of it):

  "dependencies": {
    "Microsoft.AspNetCore.AngularServices": "1.0.0-*",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.Identity": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.Mvc": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview3-final",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.Design": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.Relational": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.Relational.Design": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.Sqlite": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview3-final",
      "type": "build"
    },
    "Microsoft.EntityFrameworkCore.Tools.Core": "1.0.0-rc2-final",
    "Microsoft.Extensions.Configuration.CommandLine": "1.1.0-preview1-final",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0-preview1-final",
    "Microsoft.Extensions.Configuration.Json": "1.1.0-preview1-final",
    "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0-preview1-final",
    "Microsoft.Extensions.FileProviders.Abstractions": "1.1.0-preview1-final",
    "Microsoft.Extensions.Logging": "1.1.0-preview1-final",
    "Microsoft.Extensions.Logging.Abstractions": "1.1.0-preview1-final",
    "Microsoft.Extensions.Logging.Console": "1.1.0-preview1-final",
    "Microsoft.Extensions.Logging.Debug": "1.1.0-preview1-final",
    "Microsoft.Extensions.Options": "1.1.0-preview1-final",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0-preview1-final",
    "Microsoft.Extensions.Primitives": "1.1.0-preview1-final"
  },

  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview3-final"
  },

  "frameworks": {
    "net461": {}
  },

and when I run an application I got an error:

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.Abstractions, Version=1.0.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)

Do you have any idea what is wrong?

asp.net-core
.net-core
asked on Stack Overflow Oct 26, 2016 by Cieja • edited Oct 26, 2016 by Set

4 Answers

23

Try deleting the bin folder and rebuilding the solution.

answered on Stack Overflow Dec 15, 2016 by Hinrich • edited May 15, 2017 by Hinrich
0

For me this issue only happened after I published to Azure.

The fix was to update a new setting in Publish -> Configure -> Settings and set the Deployment Mode to Self-Contained.

answered on Stack Overflow May 29, 2018 by ttugates
0

Additionally to deleting bin folders I had to reboot my machine to get rid of this error

answered on Stack Overflow Aug 27, 2018 by Michael Freidgeim
0

Look into the error message carefully. I just installed the NuGet package Microsoft.AspNetCore.Html.Abstractions to the specific project and rebuilt the solution. It resolved the issue for me!

answered on Stack Overflow Nov 5, 2018 by Mosharaf Hossain

User contributions licensed under CC BY-SA 3.0