WCF service connection with third party dll with IIS

試著忘記壹切 提交于 2020-01-24 04:02:05

问题


I am working with Windows 7, VS2010, SqlServer 2008.

My application takes data form a third party dll (which takes data from another process that must be running in the background) and processes the data and send it over a WCF service to the front end.

The application is done and does what it supposed to do. Now when I want to distribute it and Run it in IIS. I am facing a strange problem. The application get the data from a dll when I run it in IIS it fails and gives an error while connecting to the dll.

Retrieving the COM class factory for component with CLSID {FCEC6861-5866-4F9E9A09-7CC868C30A8B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

After some research I found out going to component service and inside DCOM config I change the security of the dll to everyone. The error stopped.

But now I don't get the error but I don't get the data like when the software which provides the data is closed. But work ok with my ASP.net development server.

Also I found that when I run Visual Studio in administrator mode I must run the third party data software in administrative mode too.

The dll reference is not copied in bin folder automatically, it put in obj folder and I manually copied it but it does not work.


回答1:


What I think happens is that the COM component is running in the same context as the caller and it needs elevated permissions to perform its job.

So:

  • VS in admin mode, COM in admin mode, works because both are having system wide permissions to perform their work.
  • IIS running under app pool account (not sure which), COM will also be under that account, but it is not an administrator, so too low on permissions to do the work correctly.

My troubleshooting suggestion would be to have the IIS application pool that your app is running under changed to be local admin. If that works OK, restore the access rights on your DCOM to the defaults (before changing to everyone) and try again. You might also try to run the app pool under the local system account to see what happens. If that still works, you have confirmed this behavior to be the problem.



来源:https://stackoverflow.com/questions/7899172/wcf-service-connection-with-third-party-dll-with-iis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!