Runtime: Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Created on 14 Jun 2017  ·  1Comment  ·  Source: dotnet/runtime

Hi folks,

My console app (FW 4.7) raises this exception:

"An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.

Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies."

app.config:

<dependentAssembly> <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> </dependentAssembly>
Project has this line AutoGenerateBindingRedirects set to true:

<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

Package.config:

<packages> <package id="System.Runtime" version="4.3.0" targetFramework="net47" /> </packages>

My new netstandard lib is 1.6 version. It has System.Runtime version 4.3.0.0.

I have tested, but raises same execption:

<dependentAssembly> <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> </dependentAssembly>

I followed link [https://msdn.microsoft.com/en-us/library/2fc472t2(v=vs.110).aspx]

I can't understand why recent created projects raises this exception. What is wrong? I did no problems with Visual Studio 2015 but I waste hours with these kind of errors after Visual Studio 2017 v15.2 releases

Thanks

Most helpful comment

Seems Update-Package -reinstall solves my issue.

I do not understand why I have to run it every time I add nuget references ....

>All comments

Seems Update-Package -reinstall solves my issue.

I do not understand why I have to run it every time I add nuget references ....

Was this page helpful?
0 / 5 - 0 ratings