Hello fellows,
I'm scracthing my head trying to figure out a pesky issue regarding Windows Services. I have a .NET .3.5 Windows Service that references a C++ "Wrapper" DLL (that is, this dll allows me to access unmanaged code by using managed wrapper methods). The wrapper dll and all the other dlls / libs it depends on reside in the same folder, which is also where the Windows Service executable resides.
For some strange reason, the windows service throws an HRESULT: 0x8007007E (specified module could not be found) exception when it runs as LocalSystem (the default). If I force the service to run as my personal admin account, everything works fine (except that I run into other issues that are out of the scope of this posting). So I would like to ask you if there is anything special I need to do to allow my service to find and use the wrapper assembly while running as LocalSystem.
I have tried moving all the wrapper dll (and its dependent dlls/libs) to c:\windows\system32 and also set the current directory (Directory.SetCurrentDirectory() method) to that of the local process, all to no avail. I even tried setting both the System and Local User PATH environments to point to the folder containing all the required DLLs, also without luck. At any rate, I don't *think* the problem is the PATH, because all the required DLLs reside in the same folder as the service executable.
My environment is Windows Vista.
Any suggestions? I'm out of ideas at this point :-(
Thank you very much in advance!