question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET library dependencies fail to load?

See original GitHub issue

I’ve been working on getting a .NET5 library (e.g. SimulationExports.dll) to work properly when called from native. This all works until the code requires an additional .NET5 library dependency (e.g. SimulationCore.dll) at which point I get:

Unhandled exception. System.TypeInitializationException: The type initializer for 'SimulationExports' threw an exception.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'SimulationCore, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

In my case SimulationExports.dll and SimulationCore.dll sit side-by-side along with SimulationExports.runtimeconfig.json

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jeffasoncommented, Dec 21, 2020

A workaround linked in dotnet/sdk#14946 seems to fix my issue with the faulty *.deps.json so I think this issue can be closed. I’ll open a new issue if I run into anything else. Thanks for your help and great work on DNNE!

1reaction
jeffasoncommented, Dec 14, 2020

cross-linking the issue I opened in the other repo - https://github.com/dotnet/sdk/issues/14946

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sub-dependencies of an .NET Core Assembly failed to ...
A short summary of the structure: I have an executable project that gets some interfaces on a .NET Core Library in the same...
Read more >
How can I dynamically load .NET core library with . ...
0), and still load it dynamically, it works. The difference is the .deps.json - it lists the dependencies of the DLL (.NET6.0). Building...
Read more >
How to resolve “Could not load file or assembly … or one of its ...
NET \Framework\v4.0.30319\config\machine.config.LOG: Post-policy reference: Newtonsoft. ... Then coming to question why error of assembly cannot be loaded?
Read more >
15.5.2 Dependencies failed to load / Cannot add reference
Upon loading a previously working dot net core web app project in VS 15.2.2, All items listed under "Dependencies" have a yellow ...
Read more >
Runtime error with System.Native : Unable to load shared ...
DllNotFoundException: Unable to load shared library 'System.Native' or one of its dependencies. In order to help diagnose loading problems, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found