Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have add a .dll file as a reference in my winform c# project.

The output is one .exe file and one .dll file.

It works well when I run the .exe file in bin/debug folder .. or any other folder on my own computer.

For running the .exe file in other computers, I simply copy both .exe file and the .dll file in a folder..

I got confused that it works in some computers, but it pops up stop working error in others :

C#
Problem signature:
   Problem Event Name:                        CLR20r3
   Problem Signature 01:                       programname.exe
   Problem Signature 02:                       0.0.0.0
   Problem Signature 03:                       4e20a786
   Problem Signature 04:                       mscorlib
   Problem Signature 05:                       2.0.0.0
   Problem Signature 06:                       4d8c1599
   Problem Signature 07:                       f9b
   Problem Signature 08:                       80
   Problem Signature 09:                       System.IO.FileNotFoundException
   OS Version:                                          6.1.7600.2.0.0.16.7
   Locale ID:                                             1033


After using exception control, I got this error details:

C#
System.IO.FileNotFoundException: Could not load file or assembly 'dllname.dll' or one of its dependencies. The specific modulo could not be found.


What's the problem! both files(.exe and .dll) are in the same folder ! It works on some PCs !

Note that required .Net Framework is installed on all computers. with the same versions.

Note that I use x86 build architecture and the problem is the same on both x86 and x64 systems.

Note that one time I've installed MS Visual Studio 2012 and after that the error message disappeared and the program worked correctly after that !! I don't know what could be the relation between installing VS 2012 and the problem !

Note that the program also works well in PCs with no VS installed !

Thanks any help in advance.
Posted

1 solution

The error message says "Could not load file or assembly 'dllname.dll' or one of its dependencies."
Try running Dependency Walker[^] on your DLL on one of the systems where it does not run.

Soren Madsen
 
Share this answer
 
Comments
OriginalGriff 22-Feb-14 3:45am    
:thunmbsup:!
SoMad 22-Feb-14 3:49am    
Thanks. BTW, do you know when Dependency Walker was removed from the Microsoft Windows/Platform SDK tools and took on a life of its own?

Soren Madsen
OriginalGriff 22-Feb-14 4:07am    
Sorry - can't help you there - I have no idea...
Mohamad77 23-Feb-14 14:45pm    
Thanks alot SoMad. I've found the missing system dlls and installed.
SoMad 23-Feb-14 14:48pm    
Awesome! Glad I could help.

Soren Madsen

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900