简体   繁体   中英

Updating to .NET Standard 2.0 Nuget packages

I have updated my nuget packages for an existing project. I have updated all of my packages, including the .NET Standard 2.0 nuget package. Now I am getting the error message below.

Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

I've tried to to clean, rebuild, rebooted, etc. I've googled and think that this is in reference to the .NET Standard 2.0 nuget package. I've got some entries in my runtime assembly binding section of my web.config.

I would think that I would need to reference Runtime 4.3.0.0, but I don't see a way to do this. Any suggestions are appreciated. TIA.

If you are not using ASP.NET Core, you can set assembly for System.Runtime in system.web section in web.config . By the way, please configure your .NetFramework version , too.

 <system.web>
    <httpRuntime targetFramework="4.5.1" />
    <compilation debug="true" targetFramework="4.5.1">
      <assemblies>
        <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      </assemblies>
    </compilation>
  </system.web>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM