AspNetCore Abstractions无法加载

时间:2016-10-26 07:10:48

标签: asp.net-core .net-core

我使用ASP.NET Core + Angular 2 template for Visual Studio。我已经更新了我的project.json文件,它现在看起来(它的一部分):

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)

当我运行应用程序时出现错误:

 !*************
 ! common.i90
 subroutine export_name
   print *, name
 end subroutine export_name

!*************
! elsewhere...

module export_cat
  use cat
contains
  include 'common.i90'
end module export_cat

module export_dog
  use dog
contains
  include 'common.i90'
end module export_dog
...

你知道出了什么问题吗?

4 个答案:

答案 0 :(得分:23)

尝试删除bin文件夹并重建解决方案。

答案 1 :(得分:0)

对我来说,此问题仅在我发布到Azure 后发生

修复方法是更新Publish - >中的新设置。 Configure - > Settings并将Deployment Mode设置为Self-Contained

答案 2 :(得分:0)

除了删除bin文件夹外,我还必须重新启动计算机才能摆脱此错误

答案 3 :(得分:0)

仔细查看错误消息。我刚刚将NuGet包Microsoft.AspNetCore.Html.Abstractions安装到了特定项目,然后重新构建了解决方案。它为我解决了这个问题!