简体   繁体   中英

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.

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. (Exception from 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.

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. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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