Visual Studio Difference between Local IIS and Express IIS


I am trying to create xlsx file using

When I run the web application in VS with IIS express it works prfectly, but when I run it in VS with local IIS I get:

{"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 get the same exception on my server, server version: windows server 2016, IIS version: 10.0.14393.0

Note: DCOMC config contain Microsoft Excel Application.

asked on Stack Overflow Mar 14, 2018 by nel siboni • edited Feb 13, 2019 by Dale K

1 Answer


When you execute IIS Express, the pool use your windows account, that have the right to access and launch Excel.

By default, local IIS use ApplicationPoolIdentity, so if you want execute external assembly, the best way is to change identity of pool by your windows account (or account created for this usage).

enter image description here

answered on Stack Overflow Mar 14, 2018 by User.Anonymous

User contributions licensed under CC BY-SA 3.0