如何调用非托管code在ASP.NET网站和IIS主机呢?

问题描述:

我创建了一个C ++ DLL。它工作正常,并没有工作。

I have created a C++ dll. It works fine and does the job.

我已经创建了asp.net调用C ++中的dll方法的方法。 DLL的路径是绝对的。它工作正常了。

I have created methods in asp.net that call the methods in C++ dll. DLL path is absolute. It works fine too.

然后我公布在网站上的一个文件夹并托管在网站上IIS。我得到一个错误信息

I then published the website onto a folder and hosted the website on IIS. I get an error message

Exception Details: System.DllNotFoundException: Unable to load DLL 'FilesCreator.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

请建议什么,我需要做的就是它的工作。

Please suggest what I need to do to get it to work.

你确认这是运行你的应用程序的应用程序池的身份验证的用户具有适当的权限读取和执行DLL?

Did you confirm that the authenticated user of the application pool which is running your app has the appropriate permissions to read and execute the DLL?

尝试添加权限谁是竞选IIS7的应用程序池的用户。对于IIS6,如果您使用的是匿名身份验证试图给予同意后配置在Web站点设置IIS匿名用户。
见here对于IIS6 和这里IIS7

Try adding permissions for the user who is running the application pool for IIS7. For IIS6, if you are using anonymous authentication trying giving permission to the IIS anonymous user as configured in your Web Site settings. See here for IIS6 and here for IIS7.