我使用C#.NET开发了一个Windows服务来生成PDF报告.要生成PDF文件,我使用的是第三方dll.该应用程序在我的Windows XP平台上运行.当我在Windows Server 2008 64位版本中部署该服务时,我收到此错误:
由于以下错误,检索具有CLSID {46521B1F-0A5B-4871-A4C2-FD5C9276F4C6}的组件的COM类工厂失败:80040154.
我使用regsvr32命令注册了DLL.我能够在注册表中看到这个CLSID.但问题仍然存在.
可能是什么问题呢?
我在Visual Studio 2008中遇到C#ASP .NET项目的问题当我使用Windows 7 Ultimate(x64)重新安装我的计算机时,问题就出现了.对此我也使用Office 2007.
我得到的错误信息是:
System.UnauthorizedAccessException:检索具有CLSID {000209FF-0000-0000-C000-000000000046}的组件的COM类工厂因以下错误而失败:80070005.at xxx.Utility.WordDocument..ctor(String filePath,HttpServerUtility util)at customer_communication.BuCreate_click(Object sender,EventArgs e)位于c:\ xxx\Website\customer\communication.aspx.cs:第127行
我正在使用 Interop 打开 Excel 实例来检索一些数据。然而以下行:
Application xlApp = new Microsoft.Office.Interop.Excel.Application();
Run Code Online (Sandbox Code Playgroud)
给出了这个错误:
System.Runtime.InteropServices.COMException
HResult=0x80080005
Message=Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
Source=mscorlib
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, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, …Run Code Online (Sandbox Code Playgroud)