【发布时间】:2016-12-20 13:28:40
【问题描述】:
我在 ASP.NET MVC 站点中使用 Redemption 读取 .msg 文件,进行一些更改并将其输出给用户。它可以在我的开发机器上运行,但是当我在登台服务器上尝试时,我收到了这个错误。
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at Redemption.RedemptionLoader.IClassFactory.CreateInstance(Object pUnkOuter, Guid& refiid, Object& ppunk)
是因为我没有在服务器上安装 Outlook 吗?我的理解是不需要 Outlook。我还尝试使用 regsvr32.exe 注册 DLL,但这没有帮助。
更新:我安装了 Dmitry 建议的独立 MAPI,并重新构建了我的网络应用程序以针对 x64 平台。服务器是 Windows Server 2008 R2 x64,所以我认为 64 位是正确的目标。但它仍然给我同样的错误。我的代码如下所示:
RedemptionLoader.DllLocation64Bit = Server.MapPath("~/bin/dlls/Redemption64.dll");
RedemptionLoader.DllLocation32Bit = Server.MapPath("~/bin/dlls/Redemption.dll");
Interop.Redemption.RDOSession session = RedemptionLoader.new_RDOSession();
第三行抛出错误。我错过了什么吗?
我还尝试将站点编译为以 x86 为目标,但此时 IIS 不会加载站点 .dll。
【问题讨论】:
-
编辑您的应用程序池的高级设置,“启用 32 位应用程序”。
标签: asp.net-mvc outlook-redemption