简体   繁体   English

c# Web 服务引用 c# 项目引用 Z5884E40D596370BE5406F2711AD9E39

[英]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.好吧,也许这是不可取的,但我正在为现有应用程序编写 Web 服务。 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'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. 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} “无法加载 DLL 'foo.dll':找不到指定的模块。(来自 HRESULT 的异常:0x8007007E)”} System.Exception {System.DllNotFoundException}

A sample of the import from the c# Library:从 c# 库导入的示例:

[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.我尝试将 foo.dll 添加到我的项目的 Bin 目录中,但这不起作用。 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.我已经阅读了一些关于 DLL 和 web 服务的时髦内容,并尝试了一些修复程序,例如http://sites.google.com/site/tosapage/programming/asp-net#dll ,但它们不起作用。

I would run the winforms exe with depends.exe .我会用depends.exe运行 winforms exe。 You might be getting that error for a dell that the dll you are calling needs.对于您正在调用的 dll 需要的戴尔,您可能会遇到该错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM