I have a project that uses a Java library converted using IKVM. I added the created DLL plus all possible IKVM DLLs as references to my project, but when I run it, I get the following runtime error:
System.IO.FileNotFoundException : Could not load file or assembly 'core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I'm not really sure how to debug this error. Is there a way to know exactly which type is missing? From the description I'd guess this is the generated DLL (from the Java lib) but I have properly added it as reference.
What else have I done wrong?
There are some workarounds for this issue: The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for.
In summary if you get the "Could not load file or assembly error", this means that either your projects or their references were built with a reference to a specific version of an assembly which is missing from your bin directory or GAC.
This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running.
This error means that ASP.NET was not able to find the EnterpriseLibrary dll. To fix it, try install Enterprise Library on the web server or upload the required dll into the bin folder.
You can use the Fusion Log Viewer to debug assembly loading problems in .NET apps.
Also, Process Monitor is very useful in identifying general file-load problems.
Just chiming in that dependency walker and fusion log viewer dont work well for applications that have native and managed code together or doing dynamic loading of native code. Here is a good post explaining step by step how to solve missing (or invalid permission) assembly errors using process monitor that covers those scenarios:
Debug Could not load file or assembly or one of its dependencies error with Process Monitor
The post also includes a tool to automate some of this task as well
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With