473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

COM class error 80040154

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:

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
Apr 29 '09 #1
10 32024
Frinavale
9,735 Expert Mod 8TB
Edit: check out this quick summary/article that I did on the COM class error 80040154

What operating system? Is it 64 bit?

This problem could be caused by not registering/installing the DLL correctly or if permissions are not configured properly to allow the user running the ASP.net application access to the DLL.

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

Please read further down for more instructions on how to use the regsvr32 tool on 64bit operating systems.

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

Make sure that the user that will be using the application has sufficient permissions to access the DLL (at least read/execute...but you may need more if your application requires it). If you're not using impersonation, the default anonymous user account is the ASPNET, or IIS_IUSRS and IIS_WPG Windows user account.

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 if your COM object is 32bit and it exists in a SysWOW 64 folder on 64 bit operating systems You SHOULD NOT give read/write permissions to the anonymous user account on this folder (in fact I think the operating system prevents you from doing this). This could compromise your operating system!

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).

So, if your COM component is in the SysWoW64 folder, move it out of there to somewhere that you can apply permissions to that will allow the internet user to use the COM component and prevent them from accessing anything else. Once you have done this and applied the correct permissions, you need to use the 32 bit version of the regsvr32 tool to register the 32 bit COM component. This tool is located in the C:\Windows\SysWoW64\ directory. The regular regsvr32 tool is meant to register 64bit components (this regular tool is located in the C:\Windows\system32\ folder).

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


Also, please note that if your COM component is 32bit you need to configure your build settings in your Visual Studio project to target the x86 platform (the 32 bit platform). If your project is targeting a 64 bit platform, you will continue to get this error.

I guess I could have summed everything up into 4 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
  • Make sure that you use the correct regsvr32 tool to register the COM component
  • Make sure that you have configured your project to target the appropriate platform (ie: it must target a x86 platform if the COM component is a 32 bit component)

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.

A Note Specific to running ASP.NET application: you need to make sure that your website is running under a 32bit application pool. Setting the application pool is different for each version of IIS, so please research this topic so that your application can run properly.
May 1 '09 #2
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
May 4 '09 #3
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.
May 5 '09 #4
COM class error 80040154
Apr 28 '10 #5
Frinavale
9,735 Expert Mod 8TB
PBODDEN, do you have a question?
Apr 28 '10 #6
@Meganutter
Hey there,

I think I might be having a similar issue. Meganutter - can you eleborate on the changes you did? I'm in C# WinForms app trying to use a COM DLL that wraps some legacy C++ code. I'm getting the same error when newing-up the object. I've run Dependency Walker on all the need DLL's and everything 'looks' good. So, your find is interesting.

Thanks,

Stretch
Jun 25 '10 #7
Frinavale
9,735 Expert Mod 8TB
Did you register the DLL using the regsvr32 tool?

-Frinny
Jun 25 '10 #8
@Frinavale
Hey Frinny... I got past my initial issue. I didn't have 'admin' rights and when I got those rights, then the register/unregister and DLL works as it was supposed to. What was strange is it would tell me that the DLL registered successfully... and it wouldn't let me unregister it. Not sure why that only 'appeared' to work one way and not the other.
Jul 1 '10 #9
Frinavale
9,735 Expert Mod 8TB
Thanks for sharing that with us.


-Frinny
Jul 1 '10 #10
Frinavale
9,735 Expert Mod 8TB
Edit: check out this quick summary/article that I did on the COM class error 80040154

Just wanted to add an additional comment about this error with regards to 32bit components running under 64 bit Operating Systems.

First of all, you need to use the appropriate regsvr32 tool to register the 32 bit COM component. The version of the regsvr32 tool that you need to use is located in the C:\Windows\SysWoW64 folder. If you simply type regsvr32 in the command line tool, it will use the regsvr32 tool located in the C:\Windows\system32 folder but this tool should only be used to register 64bit components.

If you are still getting this error and you are sure that you have applied the correct permissions to the COM object that you are trying to reference, and you are sure that you have registered your 32bit COM object using the regsvr32 tool in C:\Windows\SysWoW64 folder, then you need to make sure that your build settings are targeting a 32 bit platform.

So, when using a 32 bit COM object on a 64 bit operating system you need to:
  1. Run CMD (command line) as administrator
  2. Change directories to the folder where the COM object resides
  3. Type C:\Windows\SysWoW64\regsvr32 name-of-your-component and hit enter to execute the 32 bit version of the regsvr32 application and register your COM component with the Windows registry
  4. Ensure that the COM component has the correct permissions set on it to allow the user of the application access to execute it. Also ensure that the containing folder has appropriate permissions applied to it.
  5. Open your Visual Studio project:
    • Go to the Build menu and choose the Configuration Manager option
    • Choose x86 as the platform (if it is not in the options under your platform, click <new> and choose x86 to add it as an option)
    • Re-reference the COM component
    • Build and run.

-Frinny
Nov 8 '13 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Martin Franklin | last post by:
I am trying to get a total record count on a Acess 97 mdb database. However I get the following error when I try to load the page: Provider error '80040154' Class not registered...
2
by: Zardoz | last post by:
I've created a new header file in which one will find : #using <mscorlib.dll> using namespace System; __gc class G { public: int k; int sum(int){return 0;}
4
by: omrivm | last post by:
Hi, I have a problem with Outlook Redemption, every time I'm trying to create a new RDOAddressBook: Redemption.RDOAddressBook AB = new RDOAddressBook(); I get: "Retrieving the COM class factory...
0
by: Shailesh Patel | last post by:
Hi, I get the following error. Retrieving the COM class factory for component with CLSID {F84433FF-2369-4427-B6FB-3CBA67EDA7EB} failed due to the following error: 80040154 ASP.NET(VB.NET)...
2
by: RodneyAnonymous | last post by:
I've got some code for composing an e-mail from the contents of an RTF box. The first time I execute it, everything works fine. If I close my app and then re-run it, however, I always receive the...
4
by: mojde | last post by:
Hi all, I am using : 1. Windows XP-Visual Studio 2005 2. FastReport Studio Trial (www.fast-report.com) I have used FastReport Studio Trial (FastReport3.dll) in my ASP.NET web Site...
3
by: mojde | last post by:
Hi all, I am using : 1. Windows XP-Visual Studio 2005 2. FastReport Studio Trial (www.fast-report.com) I have used FastReport Studio Trial (FastReport3.dll) in my ASP.NET web Site...
4
by: comtrendz | last post by:
Application fails with error: 80040154 when attempting to open a doc in Word 2010. I have a VB.Net app that uses word to open documents. I am running VS 2008 on my PC with Office 2003. When I...
1
seraieis
by: seraieis | last post by:
(VB.NET) I've been searching for 3 days trying to figure out why this is happening, but I'm out of luck and out of my mind! Anyone have any idea why this is happening? I get this error as soon as I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.