Atlanta ASP.Net MVC Developer/ Architect
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
| Print article | This entry was posted by Paul Lockwood on December 16, 2008 at 7:09 am, and is filed under ASP.Net MVC. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
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 1 year 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 1 year ago
nevermind – I’m running 32bit Vista, so not applicable.
..s.till searching for a solution.
about 1 year ago
Jon, did you try regsvr32? I’ll email you..
about 1 year 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 10 months ago
thank you thank you…
about 8 months ago
Thanks, This information helped me out a lot!
about 7 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 7 months ago
Anita, you might want to try asking on StackOverflow.com
about 6 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 6 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 6 months 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 6 months 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
about 3 months ago
I looked for about an hour to figure this out with no luck, my problem was I was looking to the vendor of the dll and they had nothing. Worked perfect thank you!
about 3 months ago
Thanks for leaving the comment Matt. Only a small percentage of people leave comments but this page receives a lot of traffic from search engines. I bet it has saved man-months of time.
about 1 month ago
Thanks a lot ! Great ! Saved my project !
about 1 month ago
Paul, I’m using IIS 6.0. How can I fix this issue? Thanks
about 1 month ago
@Norbs: This post won’t help with IIS6 at all. You are probably hitting the common regsvr32 issue. i.e. you just need to register the COM object – there many posts out there that cover this
about 2 weeks ago
I can’t tell you how much time I put in to trying to resolve this to no avail. Everything worked fine in the ASP.NET Visual Web Developer 2010 Web Development Server, Cassini, but I got the Com Component not registered error when publishing to IIS 7 on my remote Windows 2008 x64 box. THANK YOU!!!!!