I have one solution with two example projects. One is an exe Windows Forms final program and one is a dll library. I see, that final exe works perfectly on different computers. So.. Do i have to include additionally SecondProject.dll with my FirstProject.exe when sharing my program with others? Or is the dll file already included inside the FirstProject.exe file?
I am confused because I’ve tested the FirstProject.exe file on few computers and it works perfectly. Am I missing something?
[SOLVED] details in my answer below..
No, a DLL assembly has to be distributed with the exe. The only reason it works on different computers without error is that maybe your exe doesn’t actually USE the DLL. The dll is loaded when you first use a class or call a method from that assembly.
Another reason may be that you catch all exceptions in your code, including the
DLLNotFoundExceptionand it SEEMS your code is working, whereas in reality it doesn’t do what you expect it to…In any case you can’t link statically to a library in .NET.