【问题标题】:System.Runtime.InteropServices.COMException with Redemption on web serverSystem.Runtime.InteropServices.COMException 与 Web 服务器上的兑换
【发布时间】: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


【解决方案1】:

兑换需要安装 MAPI 系统,这意味着必须安装 Outlook 或 standalone version of MAPI。 还要确保您的代码位数与 MAPI 系统的位数相匹配 - 请参阅 http://www.dimastr.com/redemption/faq.htm#ErrorCreatingRedemptionObject

【讨论】:

  • 德米特里,谢谢您的回复。但我仍然收到错误。请看我上面的更新。
  • MAPI 的独立版本只有 32 位,因此您的代码必须构建为 x86。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2010-10-29
  • 2011-07-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-20
  • 1970-01-01
相关资源
最近更新 更多