我的 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/