DLL dependency woes
-
Hi all, I posted earlier about a problem I had with DLL dependencies in ASP.NET. I followed up saying I'd solved the problem, but I was being foolish (I'd forgotten to un-stub some critical functions that forced linking). Basically, I have the following setup: ASP.NET Page --[DllImport]--> C++ Wrapper.DLL -- [static link to] --> C++ Unmanaged.DLL "Wrapper.DLL" is in the web page \bin directory. I always get the error "File or assembly name Wrapper, or one of its dependencies, was not found". This is because it can't find "Unmanaged.DLL". If I remove all references to "Unmanaged.DLL" in "Wrapper.DLL" and stub out all functions, then the web page loads fine (i.e. I know there are no problems finding "Wrapper.DLL" itself - it must be failing to find "Unmanaged.DLL"). If I put "Unmanaged.DLL" in \windows\system32\ then the web page loads fine. If I put "Unmanaged.DLL" anywhere else, I get the "File or assembly... not found" error. What is going on here? There must be a place that I can put my DLLs that isn't the windows system folder... Andy
-
Hi all, I posted earlier about a problem I had with DLL dependencies in ASP.NET. I followed up saying I'd solved the problem, but I was being foolish (I'd forgotten to un-stub some critical functions that forced linking). Basically, I have the following setup: ASP.NET Page --[DllImport]--> C++ Wrapper.DLL -- [static link to] --> C++ Unmanaged.DLL "Wrapper.DLL" is in the web page \bin directory. I always get the error "File or assembly name Wrapper, or one of its dependencies, was not found". This is because it can't find "Unmanaged.DLL". If I remove all references to "Unmanaged.DLL" in "Wrapper.DLL" and stub out all functions, then the web page loads fine (i.e. I know there are no problems finding "Wrapper.DLL" itself - it must be failing to find "Unmanaged.DLL"). If I put "Unmanaged.DLL" in \windows\system32\ then the web page loads fine. If I put "Unmanaged.DLL" anywhere else, I get the "File or assembly... not found" error. What is going on here? There must be a place that I can put my DLLs that isn't the windows system folder... Andy
hi, As far as I know... Whenever you refer to an unmanaged DLL the CLR tries to locate the DLL in "system32"... if it can't find there then it looks for the DLL in all the folders mentioned in the "Path" environment variable... So this emplies that if you need to keep the DLL in some other place other than system32 then `you need to put the path in the environment variable... To set the environment variable please refer to a recent post in .NET Framework message board where a person has explained how to set the environment variable programatically... Hope this solves your problem... please don't mind if I have missed on something... regards, Aryadip. Cheers !! and have a Funky day !!
-
hi, As far as I know... Whenever you refer to an unmanaged DLL the CLR tries to locate the DLL in "system32"... if it can't find there then it looks for the DLL in all the folders mentioned in the "Path" environment variable... So this emplies that if you need to keep the DLL in some other place other than system32 then `you need to put the path in the environment variable... To set the environment variable please refer to a recent post in .NET Framework message board where a person has explained how to set the environment variable programatically... Hope this solves your problem... please don't mind if I have missed on something... regards, Aryadip. Cheers !! and have a Funky day !!