Visual C # "Failed to load file or assembly or one of its dependencies"

I looked through this problem, and I found a lot of posts online about it. But I didn’t understand anything. maybe you can help? I have a dll file (created using c script) and I created a GUI using Visual C # 2010 for my program. I tested my application on 5 different computers. On my computer and the computer where I created the application, the user interface and the program work without any problems. However, when I pass it to other computers, I get the following line of errors AFTER the program runs (which means that the user interface opens, but when I insert all my values ​​and run the code stored in the dll file, I get errir) "Could not load file or assembly "ParsingDll.dll" or one of its dependencies. The specified module was not found. "

All computers run Microsoft 7 and 64 bit windows. The dll file "ParsingDll.dll" is the one that contains my GUI code and is located in the same folder as the executable.

Understand this if someone can help me with this and do it step by step with me as they are new to these kinds of things.

Many thanks to all of you.

+4
source share
3 answers

One of the assemblies used may require a (native) library that is not available.

You can enable welding logging to see what exactly causes the problem:

Here, what is loaded is recorded, and where the merge loader is looking for assemblies, enable fusion logging in the registry:

Add the following values ​​to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion 

Add

  DWORD ForceLog set value to 1 DWORD LogFailures set value to 1 DWORD LogResourceBinds set value to 1 String LogPath set value to folder for logs eg C:\FusionLog\ 

This folder must exist and end with a backslash.

(instructions copied from How to enable assembly failure logging (Fusion) in .NET )

+6
source

Import the dll and compile all projects, including the DLL. Update, restart the computer, if necessary, restart the computer. Verify that the DLL exists on the computer. Reboot, upgrade, recompile, clean, fix.

0
source

Check if your ParsingDll.dll is blocked. You can check by looking at the properties of the dll file. If it is locked, the "Unblock" button will appear.

0
source

Source: https://habr.com/ru/post/1439270/


All Articles