Connecting Tech Pros Worldwide Forums | Help | Site Map

COM class error 80040154

Member
 
Join Date: Mar 2009
Posts: 44
#1: Apr 29 '09
Hello,

I have been stuck with this error for a while now and really want to get it fixed.
The catch here is, i need to rewrite code and update it.
when i use the old code the page loads as its supposed to do, but on the new page it gives the following error:

Quote:
Retrieving the COM class factory for component with CLSID {CEF57A3B-0C6A-4D88-8167-C8473751AA8D} failed due to the following error: 80040154.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {CEF57A3B-0C6A-4D88-8167-C8473751AA8D} failed due to the following error: 80040154.
Before the common things start pouring in...

regsvr32 <dll> - Gives error "entry point not found, further google had no usable results"
regasm <dll> /tlb:<dll> - "no .NET dll file"-ish error
no debug platform to set to x86 nor x64 only .NET
No registry key with the CLSID
No component in the DCOMConfig
Its a custom dll file, so most pages are useless since they reference to Excel or some other application

thanks in advance

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#2: May 1 '09

re: COM class error 80040154


What operating system? Is it 64 bit?

You need to uninstall the old COM object using regsvr32:
regsvr32 -u <dllName>.dll


Please note that if the old COM object doesn't exist anymore you're going to have a problem. If possible make sure the old COM object is in the directory where it was registered and then call the regsvr32 to uninstall it.

Once uninstalled, remove the old DLL and replace it with the new one and then run the regsvr32 command:
regsvr32 <dllName>.dll

Please note that if you run the following it sometimes comes up with the message about no entry points found so stick with the command listed above:
regsvr32 -i <dllname>.dll

Once you've done this try running the application again.
If you're still having problems then I would suggest uninstalling the DLL again and then go through the registry looking for any entries for your DLL that may not have been removed/uninstalled properly. If there are entries in your registry referencing any old DLL (that no longer exists) then you're going to have problems.

Once you have uninstalled the COM object and cleaned your registry of it try registering your new one using regsvr32.

Please note that 32 bit com objects have to exist in a specific folder on 64 bit operating systems in order to run....

Also please note that the folder that the COM object is placed into must be accessible to the ASPNET application (especially if the COM object is reading/writing files etc). The folder that 32bit DLLs run in on a 64 bit operating system cannot be given permissions that let the ASPNET user account gain access to it,

I have switched back to a 32 bit server because I was unsuccessful in setting permissions that allowed my asp.net application access to essential 32 bit COM components.

Also, if your COM object is really a true com component (not developed using .NET code) then regasm will not work.

I guess I could have summed everything up into 2 points:
  • Make sure that you uninstall All old versions of the DLL before attempting to install the new one
  • Make sure that your ASPNET user account (the account under which your ASP.NET application runs) has permissions to access the COM object

I think the second point is probably what's giving your problems here :) mainly because whenever I see 80040154 errors I can fix them by setting the appropriate permissions on the DLL....I see 0x80004002 when things aren't installed/referenced properly.
Member
 
Join Date: Mar 2009
Posts: 44
#3: May 4 '09

re: COM class error 80040154


hi thanks for replying, i just tried your points.

Uninstalling and Reinstalling didnt work, all dll files and the commands gave "entry point not found" whether it was install or uninstall.
I made sure the everyone user has full control on the folder and even done quite "agressive" and made everyone part of administrators.

the OS is 32bit Win2k3 Server

thank you for your time
Member
 
Join Date: Mar 2009
Posts: 44
#4: May 5 '09

re: COM class error 80040154


follow up:

i fixed the problem, i was creating a new object. in the old code a new instance of the object is never made but filled when used.
somehow it didnt like the new() statement.
Reply