Webapp,api call Excel, Word,bartender and other DCOM, vs debugging No problem, publish to IIS error, similar to the following
"Message": "An error has occurred.",
"Exceptionmessage": "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-c000-000000000046} FAI LED due to the following error:80070005 Access is denied. (Exception from hresult:0x80070005 (e_accessdenied)). ",
"Exceptiontype": "System.UnauthorizedAccessException",
A lot of information on the Internet, but also tried a lot of methods, the reason should be IIS invoke DCOM with the user name permissions problem, vs debugging with the native system account, and IIS with the Applicaiton pool definition of the account, if this account does not have the appropriate start DCOM permissions, Then there will be an access error.
The last simple solution is to correct the identity of the Applicaiton pool LocalSystem and then change the identity of Excel or other DCOM applications to interactive in the DCOMCNFG.exe component service. User, most of all, this setting creates a security problem, which is not a problem if it is used internally.
Of course, other accounts can be configured to the appropriate permissions, the rationale should be able to, at that time, try not to, have time to look at the following link
Http://www.cnblogs.com/zhongxinWang/p/3275154.html
http://bbs.csdn.net/topics/360144511
http://blog.csdn.net/aiya1229/article/details/7031727
Https://forums.asp.net/t/1951549.aspx
Https://stackoverflow.com/questions/17785063/retrieving-the-com-class-factory-for-component-error-80070005-access-is-de
Also, some DCOM is 32-bit, in the 64-bit system with the DCOMCNFG component may not be seen, need to use the command, MMC-32 Open the console, add snap in, Component Services, should be visible.
Webapp,api call Excel, Word,bartender and other DCOM, vs Debug No problem, publish to IIS Error