.NET library dependencies fail to load?
See original GitHub issueI’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:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!cross-linking the issue I opened in the other repo - https://github.com/dotnet/sdk/issues/14946