最近在做一个.net的导出,在本地没问题,一部署到windows的iis中就处问题了报错:
如果看不到图,请看文字错误提示:Server Error in '/' Application.
--------------------------------------------------------------------------------Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a 因为配置标识不正确,系统无法开始服务器进程。请检查用户名和密码。 (Exception from HRESULT: 0x8000401A). 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a 因为配置标识不正确,系统无法开始服务器进程。请检查用户名和密码。 (Exception from HRESULT: 0x8000401A).Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
[COMException (0x8000401a): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a 因为配置标识不正确,系统无法开始服务器进程。请检查用户名和密码。 (Exception from HRESULT: 0x8000401A).]
   Segment.pages.SegmentModuel.doFileOutput() in E:\workspace\asp.net\SegementSolution\segment\SegmentModuel.aspx.cs:514
   Segment.pages.SegmentModuel.Page_Load(Object sender, EventArgs e) in E:\workspace\asp.net\SegementSolution\segment\SegmentModuel.aspx.cs:37
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 通过查询,说是有关权限问题,参考了http://ziping99.blog.163.com/blog/static/909244212009621113310518/ 后坐了修改,
确实有效,但没过几天用户又说用不了了,真是太邪恶了,于是怀疑是微软自己的excel导出控件有问题,现在又用Aspose.Cells.dll重新把导入做了一遍,等待观察是否可以? 不过支持猜测?大侠们有遇到过这种问题吗? 站在沈阳的冰天雪地里跪求赐教!

解决方案 »

  1.   

    因为配置标识不正确,系统无法开始服务器进程。请检查用户名和密码
    这个提示很明显,你本机可以,部署服务器不行。和控件应该没多大关系。好好检查一下配置文件和代码。是否有hardcode的用户名和密码
      

  2.   

    是不是服务器没装office。或者服务器是64位但装的office是32位?
    如果后一种的话,编译的时候设置为x86
      

  3.   

    hi,sp951:
    你说的原因应该不存在,因为这个导出功能,一开始部署到服务器上后,经过权限配置后,是没问题的,过了一段时间(这个时间不确定是是多长,有时候一天,有时候一周),导出功能又不好使了,需要补充一点的是:
    1.目前该应用是以需要window用户验证的方式部署在IIS中的;
    2.客户的机器是通过域来管理的,如果不在域里边是不能登录系统的;
    hi, JulioHuang:
      目前服务器是Windows Server 2007,32位操作系统,我本机也是32位操作系统,而且可以确定服务器安装了office 2007, 我想这些应该不会是原因,要不然导出功能将从头到尾都不能用,而现在的状况是:配置好权限后,导出功能在一段时间内可用,而过了一段不确定的时间(1天or3天or```)有可能就不能用了;
      

  4.   

    1,打开命令行-->输入DCOMCNFG-->打开组件服务-->计算机-->我的电脑-->DCOM配置-->找到相应的应用-->右键属性-->在标识选项中选择 启动用户 。
    2,在安全选项卡中将【启动和激活】 选为自定义,添加【network service】用户权限调至最高。
    3,【访问权限】 选为自定义,添加【network service】用户权限调至最高。
      

  5.   

    1.目前该应用是以需要window用户验证的方式部署在IIS中的;
     2.客户的机器是通过域来管理的,如果不在域里边是不能登录系统的;看来还是权限的问题,Dcom 里没有配置出来,我在config文件里加上如下这一段,重新发布 现在可以down Excel了。<identity impersonate ="true" userName="window用户名" password="密码"/>
      

  6.   

    Aspose 还是蛮实用的  基本满足所有需求
      

  7.   

    权限问题,IIS账户没有运行Excel组件的权限