简体   繁体   English

在IIS中部署后,Web API访问被拒绝错误

[英]Web API Access denied error after Deploying in IIS

I have an MVC Web API application using Excel related DLL Microsoft.Office.Interop.Excel When I run application from VS 2013, it is running under IIS express and I can send Post request to it successfully through RestClient But when I deploy this application to IIS, after sending Post request, it is giving me below error. 我有一个使用Excel相关的DLL Microsoft.Office.Interop.Excel的MVC Web API应用程序,当我从VS 2013运行应用程序时,它在IIS express下运行,并且我可以通过RestClient向其成功发送Post请求,但是当我将该应用程序部署到IIS发送后请求后,它给我下面的错误。

Unexpected Error occured while serving your RequestSystem.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. 服务您的RequestSystem时发生意外错误。UnauthorizedAccessException:由于以下错误,为CLSID为{00024500-0000-0000-C000-000000000046}的组件检索COM类工厂失败:80070005访问被拒绝。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). (来自HRESULT的异常:0x80070005(E_ACCESSDENIED))。

I have Administrator privileges in my machine and I have given all permissions to folder which contains the code. 我的机器具有管理员权限,并且已授予包含代码的文件夹的所有权限。 I have also added user IUSR and given all access to the folder having my code. 我还添加了用户IUSR并授予了拥有我的代码的文件夹的所有访问权限。

After reading the App pool identity document shared by JanneP, I have changed application Pool identity from ApplicationPoolIdentity to LocalSystem and now issue got resolved and my application is working perfectly under IIS. 阅读了JanneP共享的应用程序池标识文档后,我已将应用程序池标识从ApplicationPoolIdentity更改为LocalSystem ,现在问题已解决,并且我的应用程序在IIS下运行良好。 在此处输入图片说明

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

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