这个问题网上已经说了很多,不幸我也遇到了。

主要症状是用Microsoft.Office.Interop.Excel控件做的导出Excel的功能,在Asp.net中。

在本地测试没有问题,但是部署到web服务器上后,会出现下列错误:

Retrieving the COM class factory for component with CLSID{00024500-0000-0000-C000-000000000046} .. failed due to the following error:80070005 拒绝访问

网上的解决办法一般是:

在64位操作系统中,使用comexp.msc -32打开组件服务,找到Microsoft Excel Application的DCOM然后在属性中设置security的Lauch and Activation Permissions和Access Permission中设置NETWORK SERVICE用户,然后给local lauch和local activation的权限。

在windows10下excel导出Retrieving the COM class factory for component with CLSID .. failed due to the fol


但是对于我的计算机,这个不好用。

我的系统,解决问题的修改了IIS中的应用池配置。在IIS的Application Pools中,找到该网站的应用池:

在高级设置中,把标识修改为LocalSystem。

在windows10下excel导出Retrieving the COM class factory for component with CLSID .. failed due to the fol

我的系统是,这样修改完成后,就没有问题了。


分类:

技术点:

相关文章: