【问题标题】:How to configure DCOM configuration for Export To Excel?如何配置导出到 Excel 的 DCOM 配置?
【发布时间】:2012-12-03 11:30:26
【问题描述】:

我正在我的一个 asp.net 应用程序中实现导出到 Excel 功能。我有两台服务器(QA 和 Development)。在开发服务器中它工作正常,但在 QA 服务器中我遇到错误。

    An exception of type System.Runtime.InteropServices.COMException occurred and was 
caught. Source:mscorlib;Message:Retrieving the COM class factory for component with CLSID 
{00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a The 
server process could not be started because the configured identity is incorrect.  Check the username and password. (Exception from HRESULT: 
0x8000401A).;Target:System.MarshalByRefObject AllocateUninitializedObject(System.RuntimeType);StackTrace:   at 
System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)     at 
System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)     at 
System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)     at 
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& 
bNeedSecurityCheck)     at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)     at 
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)     at 
System.Activator.CreateInstance(Type type, Boolean nonPublic)     at System.Activator.CreateInstance(Type type)     at XXXXXXXXXXXXX  Method - XXXXXXXXXXXXX

我在两台服务器上都配置了相同的东西,但 QA 服务器仍然无法正常工作。接下来我该怎么办?有什么想法...??

【问题讨论】:

    标签: asp.net export-to-excel dcom


    【解决方案1】:

    您的 QA 服务器上是否安装了 Excel 2000?至少它无法启动自动化...

    来源:http://support.microsoft.com/kb/292491/en-us

    Excel.Application 版本无关的 PROGID 和 {00024500-0000-0000-C000-000000000046} CLSID。 COM 相关注册表 Excel 2000 的条目包括以下内容: HKEY_CLASSES_ROOT\Excel.Application\CLSID 默认值: {00024500-0000-0000-C000-000000000046} HKEY_CLASSES_ROOT\CLSID{00024500-0000-0000-C000-000000000046}\LocalServer32

    默认值:C:\PROGRA~1\MICROS~1\Office\EXCEL.EXE /automation 按照从 PROGID 到 CLSID 的注册表项,COM 可以 了解 Excel 可执行文件的安装位置并启动它 自动化。

    【讨论】:

      【解决方案2】:

      我遇到了类似的问题,即在会话之间丢失了身份,我不得不再次提供凭据以临时修复它。在调查它时,我遇到了一篇文章,该文章建议授予用作具有“作为批处理作业登录”权限的身份的域帐户,因为如果未授予该权限,则当 AD 执行更新时该身份将丢失。

      https://support.microsoft.com/en-za/help/312497/prb-com-application-under-domain-account-fails-intermittently

      https://www.brooksnet.com/faq/granting-logon-as-batch-privilege

      【讨论】:

        猜你喜欢
        • 2015-04-01
        • 1970-01-01
        • 2013-07-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-07-05
        • 2011-03-23
        • 2012-08-31
        相关资源
        最近更新 更多