0
votes

I'm using Redemption in an ASP.NET MVC site to read in a .msg file, make some changes and output it to the user. It works on my dev machine but when I try on the staging server, I get this error.

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)

Is it because I don't have outlook installed on the server? My understanding was that Outlook isn't required. I also tried registering the DLLs with regsvr32.exe but that didn't help.

UPDATE: I installed the standalone MAPI suggested by Dmitry and rebuilt my web app to target x64 platform. The server is Windows Server 2008 R2 x64 so I assume 64 bit is the correct target. But it is still giving me the same error. My code looks like this:

RedemptionLoader.DllLocation64Bit = Server.MapPath("~/bin/dlls/Redemption64.dll");
RedemptionLoader.DllLocation32Bit = Server.MapPath("~/bin/dlls/Redemption.dll");
Interop.Redemption.RDOSession session = RedemptionLoader.new_RDOSession();

The third line is throwing the error. Am I missing something?

I also tried compiling the site to target x86 but IIS won't load the site .dll at that point.

1
Edit your app pool's advanced settings, 'enable 32-bit applications'.Chalky

1 Answers

1
votes

Redemption requires the MAPI system to be installed, which means either Outlook or the standalone version of MAPI must be installed. Also make sure the bitness of your code matches the bitness of the MAPI system - see http://www.dimastr.com/redemption/faq.htm#ErrorCreatingRedemptionObject