Chris Crowe's Blog
Ramblings of an IIS MVP ( MVP Since 1997 )

Powered By IIS 7

Search my blog

Some of my readers



My Microsoft Certifications


Dec 15, 1998

Dec 20, 2000

Jan 31, 2001

Jul 22, 2002

Nov 1, 2004

My Microsoft MVP Awards




1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
mvp.support.microsoft.com

I was dealing with a MAPI application in C# and when I tried to call the following code I got a nasty error message:

MAPI.Session session = new MAPI.Session();

The actual error message I received was

Error: Retrieving the COM class factory for component with CLSID {3FA7DEB3-6438-101B-ACC1-00AA00423326} failed due to the following error: 80040154.

My development environment is:

  • Windows Vista Ultimate x64
  • Microsoft Visual Studio 2005

I found that my application Platform Target was set to Any CPU, changing this to X86 resolved the error.

image

posted on Monday, September 17, 2007 9:59 AM |

Comments


# re: Error: CLSID {3FA7DEB3-6438-101B-ACC1-00AA00423326} failed with error 80040154.

Gravatar
This is because MAPI is 32 bit only, and explicitly unsupported when called from .NET.

It will not, ever, work in 64 bit mode.

We had to write a seperate worker app in C++ to get it stable enough for commercial use, so if you are only working with Ex2007, I strongly suggest you look t the web services, NOT MAPI - it's a dog, impossible to debug and maintain once it gets complex, and microsoft will NOT support it - even if you pay - if you are calling it from .NET.

:)

Oh yeah, you mantra: close you handles ;-) tho generally, you can't force them closed in .NET, which is part of the problem. Expect to cycle the process often :)
Posted by Nic Wise on 9/17/2007 3:02 PM

# re: Error: CLSID {3FA7DEB3-6438-101B-ACC1-00AA00423326} failed with error 80040154.


mate, this post saved my life!! building an app calling 3rd partie lib's on a vista 64 ult + vs 2005 and kept breaking with that error.

i had to install a virtual pc with xp and build everytime on that!

thanks heaps.
Posted by lucas on 5/14/2008 10:26 PM

# re: Error: CLSID {3FA7DEB3-6438-101B-ACC1-00AA00423326} failed with error 80040154.

Gravatar
I have the same problem, but get resolved it with the comment.
Posted by Fabricio Gomes on 6/9/2009 1:57 AM

Post Comment


Title *
Name *
Email
Url
Comment *  
Please add 1 and 1 and type the answer here: