c# Web Service referencing c# project referencing DLL
Alright, so maybe this is inadvisable, but I'm writing a Web Service for an existing application. I'm trying to use the C# Library we wrote for the project, and that C# Library uses functions from a dll that is not acreated from a .NET project. I know the DLL isn't a problem, because the actual application (A windows form application) that uses the c# Library has no problem performing operations that use this dll, but my web service always crashes when the dll methods are called. The exception is:
"Unable to load DLL 'foo.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"} System.Exception {System.DllNotFoundException}
A sample of the import from the c# Libr开发者_JAVA百科ary:
[DllImport("foo.dll")]
protected static extern void DllFunction(string param1, int param2, int param3);
I tried adding foo.dll to the Bin directory of my project, but this didn't work. I feel like I must be missing something really obvious. Any suggestions? I've read some funky things about DLLs and web services and tried a couple of fixes such as http://sites.google.com/site/tosapage/programming/asp-net#dll but they didn't work.
I would run the winforms exe with depends.exe. You might be getting that error for a dell that the dll you are calling needs.
精彩评论