c# - Unable to load dll Exception throw when application run on different system -


i develop application in c# contain c++ dll. import dll using dllimport. application work in system. when test application different system throw

"unable load dll exception"

and in catch block display error

"dll not found"

i print path using

system.io.path.getfullpath("abc.dll") 

and put dll in return path. solution ? can run application different system. inadvance.

copied below solution - https://forums.asp.net/t/939729.aspx?unable+to+load+dll+foo+dll+the+specified+module+could+not+be+found+exception+from+hresult+0x8007007e+

you need figure out managed dll, native dll , lib files referenced application (directly or indirectly).

for managed dll, make sure in web's bin folder.

for native dll , .lib files, check out whether .dll , .lib files in path. if not, can either copy them there; or, can put them folder , add folder path. restart vs , iis (command "iisreset") make sure setting picked up.

in solution has reproduced error using following sample solution

  1. web1 references managed c++ project "mcpp1.dll". project further references 2 unmanaged c++ projects output "lib1.lib" , "lib2.lib"

  2. if copy of files web's bin folder, exception of "module not found error".

  3. i create folder "c:\lib" , copy "lib1.lib" , "lib2.lib" , add folder path. restart vs, , run "iisreset" since have iis web

  4. open vs , request page , works now


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -