.net - Why LoadLibrary does't load a dll in asmx webservice -


i developed web service (asmx ), added "defaultwebsite" in iis 8.0, called local workstation now.

i attached dll library (first.dll) "solution ->addreference->browse" mechanism in visual studio 2015.

the "first.dll" .net vs2015 assembly , needs call "second.dll" code:

using system.runtime.interopservices; ... namespace fistdlllibrary {   public class first { #region dllimport   [dllimport("d:\\pathto\\kernel32.dll", charset = charset.auto,setlasterror = true, entrypoint = "loadlibrarya")] internal static extern intptr loadlibrary([in,marshalas(unmanagedtype.lpstr)] string lpfilename);  #endregion ... private intptr hmodule; ... public first()     //the constructor of library class     {         hmodule = loadlibrary("c:\\thepath\\second.dll");         if (hmodule == intptr.zero)         {             win32lasterror = marshal.getlastwin32error();             lasterror = 1;             return;         }     } } } 

the "second.dll" not assembly , written in unknown language (possible in c++ or pascal).

the problem - when click on link "browse" in iis 8.0 explorer of web service .asmx file, "second.dll" library not loaded written in code loadlibrary("c:\\thepath\\second.dll"); . returns hmodule 0 handle. but, if switch on "server - > use default web service options" , try run vs2015 iis express, "second.dll" loads , hmodule isn't zero. verified , check more times - paths true , actual. advice, have created global variables in windows 8 paths - no effect.

why iis 8.0 cannot load "second.dll" through "first.dll" call? maybe, need add information libraries in web.config files ? but, if true, how can write in code of web.config?

thankful in advance


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -