【发布时间】:2012-12-01 15:40:02
【问题描述】:
我正在尝试在没有也不会安装 Office 的服务器上运行我的应用程序。
using EXCEL = Microsoft.Office.Interop.Excel;
...
EXCEL.Application app = new EXCEL.Application();//Exception thrown here
代码在我自己的系统上运行良好,但在服务器上却出现以下异常:
Unhandled Exception: System.Runtime.InteropServices.COMException:
Retrieving the COM class factory for component with CLSID {...} failed
due to the following error: 80040154 Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
两个系统都是 32 位的,我复制了应用程序 exe 旁边的 excel Interop dll。我还安装了O2010PIA。
有什么线索吗?
【问题讨论】:
标签: c# com interop com-interop office-interop