c# - Microsoft.office.interop.word.dll 可以在不安装 office 的情况下运行吗?

标签 c# ms-word office-interop

我的 ASP.Net-C# 应用程序使用 mailmerge 和名为 Microsoft.Office.Interop.Word.dll V14.0.0.0 的 dll。一切都在我的桌面上(安装了 office)。但是当这个应用程序部署到生产机器上时,会抛出以下错误:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

注册类时,发现如下错误:

Microsoft.Office.Interop.Word.dll was loaded but the entry-point DLLRegisterServer was not found. Make sure, this is a valid dll or OCX and try again.

如何解决这个问题?办公套件不能安装在生产机器上。

最佳答案

不,Interop 库只是真实 Office 库代码的外壳。因此,您需要在应用运行的地方安装 Office

另外,我完全同意 John Saunders 的上述评论。您真的应该避免在服务器应用程序上使用这些包装器。

关于c# - Microsoft.office.interop.word.dll 可以在不安装 office 的情况下运行吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19576080/

相关文章:

c# - 将 DataGridView 导出到 Excel 的简单方法

c# - 在嵌套异步方法中使用 ConfigureAwait

html - 从 HTML 转换为 RTF 时如何强制 Word 嵌入图像?

java - 使用 Java 的目录创建 Word/RTF 文件

c# - 文档关闭后如何有事件或运行方法?

.NET MS Interop Word 不在 UTF8 网页中保存文档

c# - ASP.NET Core Identity - LoginPartial 在脚手架身份后损坏

c# - MessageBox 是桌面模态的

c# - 我可以通过 gacutil 安装,但不能卸载相同的 dll

java - Apache POI : ${my_placeholder} is treated as three different runs