IIS7 Gotcha – COM Error 80040154
We have all seen the 80040154 COM error. Normally the solution is to run regsvr32 on the com dll so it is registered on the machine.
“System.Runtime.InteropServices.COMException (0×80040154): Retrieving the COM class factory for component with CLSID {D1CB0D81-7D2B-4064-9AC7-D0D88DEC3D16} failed due to the following error: 80040154.”
Of course regsvr32 was the first thing I did, but the error still happened in the ASP.Net MVC project on IIS7/ Server 2008. Using regedit.exe verified the dll was registered, so I ran the NUnit tests… same error! The solution is to permit the IIS7 App Pool to run 32 bit code as shown below:

IIS7 COM Gotcha
about 1 year ago
Hi Paul, I just wanted to thank you. I was having this problem at work and now i solved it. Thank you so much!!!!
Saludos desde Barranquilla, Colombia!!!
about 1 year ago
No problem, as IIS7 starts to roll out I imagine this will get a lot of hits from search engines as that is a nasty gotcha. Looking at my logs most people finding it today just have the plain jane regsvr32 issue
about 1 year ago
Thanks, worked for me.
about 1 year ago
This is not a solution–we need to run 64-bit code.
about 1 year ago
@EDS: You can still run 64 bit code as well, this fix is to permit 32 bit code in addition to 64 bit code.
about 10 months ago
I’ve trying to resolve this issue for a litle while now myself. I checked the same things you did and I’d love to try this solution, however that option is not in my Advanced Settings!
Any ideas?
about 10 months ago
nevermind – I’m running 32bit Vista, so not applicable.
..s.till searching for a solution.
about 10 months ago
Jon, did you try regsvr32? I’ll email you..
about 9 months ago
Had the same problem, after enabling 32bit apps on 64 bit 2008 server. Tried a restart the w3wp.exe service, but same problem. Restarted the entire server, and everything worked fine. We’ve experienced this on all our win 2008 servers. So try a restart (or find out what other services apart from WWW Publishing Service that needs restarting)
N. Gjermundshaug
Filemail.com
about 5 months ago
thank you thank you…
about 3 months ago
Thanks, This information helped me out a lot!
about 2 months ago
Dear Paul,
in my advanced settings I don’t have that option…I really tried to solve this problem, i did EVERYTHING, every single thing I found on net, but NOTHING worked. error 80040154 REALLY makes me angry. please,please,help me…
thanks a lot.. greeting from croatia =)
about 2 months ago
Anita, you might want to try asking on StackOverflow.com
about 2 months ago
What about 32 bit servers?
The solution you mention works for some cases where you are running a 64bit server and want to use a (32bit) ADO provider. However, what if you get this error on a 32bit server?
We are getting this error on a 32bit machine. We used regsvr to register the provider and it works, however, the issue keeps reappearing. Any known issues that may cause the regsvr registration to get lost?
about 2 months ago
I cannot be very helpful at this time, but do remember having that issue years ago with a COM object. Why it happened is not coming to mind, if it does I’ll email you
about 1 month ago
Muchas gracias hermano me salvaste la vida… ya no me sale el error pero ahora tengo el problema de conectarme al SQL Server 2008 no puedo conectar ya que la conexion esta dentro del DLL en VB6.
Desde peru muchas gracias
about 1 month ago
Julio, glad to help – good luck with the connection string. As a quick hack maybe just hex edit the dll? It might be in plaintext