C
Chris Bardon
I have some code in an unmanaged DLL that I want to call from a web
service. What I've done is use DLLIMPORT statements to create a
wrapper class like so:
public class Import
{
[DllImport("unmanaged.dll")] public static extern short Fn1(short
s);
}
And called it like so:
Import.Fn1(5);
I've placed the unmanaged.dll file in the path, and have used this
code in a local windows forms app with no problems. When I try to
place this same code in a web service though, I get a
System.DLLNotFoundException saying that it is unable to load the
managed DLL. I've tried placing copies of the DLL in various
locations (web service bin directory, wwwroot, etc) with no
improvements.
Thinking it might be a security problem, I tried running my windows
forms app as a different user, and confirmed that both the anonymous
web service user and the ASPNET account were able to run the program
and find the DLL. Is there another configuration issue here that I'm
missing? There should be no reason that I can't use this DLL in this
way, correct?
service. What I've done is use DLLIMPORT statements to create a
wrapper class like so:
public class Import
{
[DllImport("unmanaged.dll")] public static extern short Fn1(short
s);
}
And called it like so:
Import.Fn1(5);
I've placed the unmanaged.dll file in the path, and have used this
code in a local windows forms app with no problems. When I try to
place this same code in a web service though, I get a
System.DLLNotFoundException saying that it is unable to load the
managed DLL. I've tried placing copies of the DLL in various
locations (web service bin directory, wwwroot, etc) with no
improvements.
Thinking it might be a security problem, I tried running my windows
forms app as a different user, and confirmed that both the anonymous
web service user and the ASPNET account were able to run the program
and find the DLL. Is there another configuration issue here that I'm
missing? There should be no reason that I can't use this DLL in this
way, correct?