Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual C# "Could not load file or assembly or one of its dependencies"

I have looked this problem and i found many entries on the net about it.. but none that i could understand. maybe you can help? I have a dll file (created from a c script) and i created a GUI using visual C# 2010 for my program. I have tested my application on 5 different computers. On my computer and the computer where i created the application, the user interface and the program runs without any trouble. However when i pass it to other computers i receive the following error line AFTER execution of the program (which means that the user interface opens, but when i insert all my values and run the code stored in the dll file i receive the errir) "Could not load file or assembly "ParsingDll.dll" or one of its dependencies. the specified module could not be found."

All the computers run microsoft windows 7 and are 64bit. The dll file "ParsingDll.dll" is the one containing my code executed by the GUI, and it is in the same folder as the executable.

Ill appreciate it if someone could help me out with this and take it step by step with me as im new to these kind of stuff.

Many thanks to you all.

like image 666
badmanjoe Avatar asked Oct 11 '12 23:10

badmanjoe


People also ask

What is Visual C used for?

Microsoft Visual C++ is a integrated development environment (IDE) used to create Windows applications in the C, C++, and C++/CLI programming languages. It was originally a standalone product, but is now included as part of Microsoft Visual Studio.

Is Microsoft Visual C free?

A fully-featured, extensible, free IDE for creating modern applications for Android, iOS, Windows, as well as web applications and cloud services.

Is Visual C necessary?

We don't recommend that you delete any Visual C++ redistributable, because doing so could make multiple applications on your computer stop working. Given how little space they take up and how broadly they are used, it doesn't seem worth the hassle to mess with your current ecosystem of standard library files.

Is Visual Studio C or C++?

C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.


1 Answers

One of the used assemblies might require a (native) library that isn't available.

You can enable fusion logging to find out exactly what is causing the trouble:

This logs what gets loaded, and where the fusion loader looks for assemblies, turn on 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 e.g. C:\FusionLog\

This folder must exist, and end with the backslash

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

like image 179
sehe Avatar answered Oct 06 '22 05:10

sehe