0

I am having a similar problem.

I have developed a c# app that is Pinvoking a dll which is dependent on some other dlls. On dev machine it is working fine. Even when i copy the debug folder, which contains all the dlls and exe file, to a different location it works fine.

When I copy the same folder to another machine, it gives the dll not found exception.

The interesting thing is that the error message gives a path to the code file present on the dev machine. Not sure how this information is known at the target machine?

I have tried both the debug and release versions, but release version just crashes, and the debug version gives the exception message.

I have tried the dependency walker but could not figure out if there is any missing dependent dll causing the error.

I have tried to install VC++ run time redistribution package as well but it did not work.

I am using VS2013 on Win 7 64bit on dev machine. The target is Win 7 64bit. Dlls are related to tesseract OCR and copied from here.

Community
  • 1
  • 1
ResVict
  • 312
  • 2
  • 12
  • Did you hardcode the paths, either relative or absolute paths, to the DLLs? Are the 'missing' DLLs even installed on the target machine? Are the DLLs installed in the same locations on the target machine? Is the application running from the same directory path on the target machine? is the environment lib path the same on both machines? Suggest putting your effort into determining the difference(s) between the two machines. – user3629249 Feb 03 '15 at 03:10
  • sound like dependency walker tool can help you to find the missing DLL. www.dependencywalker.com/ – SHR Feb 03 '15 at 03:33
  • _"The interesting thing is that the error message gives a path to the code file present on the dev machine"_ - that can happen if the native .DLL is present **but** the native DLL depends on other modules that **are not** present. To find out for sure use a dependency viewer such as `Dependency Walker` from SysInternals. It's quite possible the native .DLL is using files in the **SxS** folders –  Feb 03 '15 at 03:34
  • @user3629249 I checked the environment variables and there was the culprit. On dev machine there was variable pointing to the data folder required by Tesseract. However, on the target machine that was not present. After creating the variable there, the problem reduced to VC++ Redistributable. So, the debug version is not working, and it should not work as the target machine does not have Visual Studio installed. However the release version works fine now. Thanks for pointing me in right direction. – ResVict Feb 05 '15 at 02:17
  • @SHR and Micky Duncan The dependency walker could not tell if I needed the VC++ distribution libraries. Or may by I did not use it properly. The problem is solved anyway. – ResVict Feb 05 '15 at 02:22

0 Answers0