今天调试 asp.net core 2.0 项目时遇到了如下错误:

    TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
System environment:
    win10 1803,VS 2017
Project enviroment:
    asp.net core,目标框架.Net Core 2.0
Stack Info:

TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.IHttpResponseStreamWriterFactory' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.2.0 ...

解决办法:

nuget安装对应版本的 Microsoft.AspNetCore.Mvc 依赖即可。

        Install-Package Microsoft.AspNetCore.Mvc

相关文章:

  • 2022-12-23
  • 2022-01-27
  • 2022-01-01
  • 2021-06-02
  • 2022-12-23
  • 2021-09-08
  • 2021-11-26
  • 2022-01-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-11-23
  • 2021-07-17
  • 2022-12-23
相关资源
相似解决方案