Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JosepBalague opened this issue Jun 14, 2017 · 1 comment
Milestone

Comments

@JosepBalague
Copy link

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

@JosepBalague
Copy link
Author

Seems Update-Package -reinstall solves my issue.

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

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants