BennyO
BennyO

Reputation: 123

NetStandard / Net Framework reference hell

I have a NetStandard 1.6 library that references an external library (System.Runtime.Loader, fetched from NuGet). If I reference my NetStandard library from a Net Framework 4.7 Windows-application I get a System.IO.FileNotFoundException when running the Net Framework application.

Full exception:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'

Now, I know full what the exception message means but I haven't got the foggiest on how to solve it in this situation.

Ideas?

Upvotes: 5

Views: 536

Answers (1)

alby98
alby98

Reputation: 47

I advise you to right click on the visual studio solution, go to manage nuget packages for the solution and check the versions of the various libraries you have. Any conflicts between the libraries will be present in the 'consolidate' tab. Alternatively, try removing the library reference from the project's reference folder and adding it back.

Upvotes: -1

Related Questions