4

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.

3
  • Which IIS version are you using? Have you checked that the app runs as IUSR? Commented Nov 9, 2016 at 10:55
  • @JanneP : IIS version is 10 and OS is windows 10. I don't know how to check if app runs as IUSR. Can you please share the process for same. Commented Nov 9, 2016 at 11:21
  • 1
    Check the application pool identity in IIS Manager: Application Pools->[YouAppPool]->Advanced Settings. A good MS article covering application pool identities can be found here: iis.net/learn/manage/configuring-security/… Commented Nov 9, 2016 at 12:33

1 Answer 1

3

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. enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.