简体   繁体   English

如何在已部署的网站(IIS 7)中使用本机DLL

[英]How to use native DLL in a deployed website (IIS 7)

I'm consuming a 32-bit native DLL from ac# web service. 我正在使用ac#Web服务中的32位本机DLL。 Everything works fine locally in VS with IIS express. 在带有IIS express的VS中,一切工作正常。 However when I deployed the site to an IIS hosting provider (IIS 7) the calls to the DLL (using platform invoke) did not work (no error, it doesn't even return from the call and the web service is terminated abruptly). 但是,当我将站点部署到IIS托管提供程序(IIS 7)时,对DLL的调用(使用平台调用)不起作用(没有错误,它甚至没有从调用中返回,并且Web服务突然终止)。 However, the client side is notified via PageMethod error function: "Unable to load DLL access is denied (exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" 但是,客户端通过PageMethod错误函数得到通知:“无法加载DLL访问被拒绝(HRESULT的异常:0x80070005(E_ACCESSDENIED))”

Since the provider IIS is running 64-bit mode, I asked them to change my process to 32-bit, however that didn't make any difference. 由于提供者IIS正在64位模式下运行,因此我要求他们将进程更改为32位,但是这没有任何区别。 Do I need to do anything special to use native DLLs on IIS 7? 我是否需要做一些特殊的事情才能在IIS 7上使用本机DLL? Do I have to register native modules with the server before they can be used? 我必须先向服务器注册本机模块,然后才能使用它们吗? Any explanation for the weird behavior when the DLL is called? 对调用DLL时的怪异行为有任何解释吗?

Thanks 谢谢

您可能已经搜索过,但似乎已经有人问过这个问题:请参阅此处的SO问题 ,但是归结为将dll放在正确的位置并设置PATH变量的原因。

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

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