C# : failed due to the following error: 80040154
-
Tuesday, June 27, 2006 6:40 AM
When i execute the following code provided by msdn, it shows error on the line Application app = new Application().
But i got some comments that it works fine in 64-bit machine. Could you please help me out. Thanks in advance.
Executed Code
using System;
using
System.Collections.Generic;using
System.Text;using
Microsoft.SqlServer.Dts.Runtime;namespace
Connections_Collection{
class Program{
static void Main(string[] args){
// The package is one of the SSIS Samples. string mySample = @"C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"; // Create an application and load the sample. Application app = new Application(); Package pkg = app.LoadPackage(mySample, null); Connections myConns = pkg.Connections; int connCount = myConns.Count; Console.WriteLine("The number of connections in the package is: {0}", connCount); // Enumerate over the collection, printing out // the values for various properties. foreach (ConnectionManager connMgr in myConns){
Console.WriteLine("ConnectionString: {0}", connMgr.ConnectionString); Console.WriteLine("CreationName: {0}", connMgr.CreationName); Console.WriteLine("DelayValidation: {0}", connMgr.DelayValidation); Console.WriteLine("Description: {0}", connMgr.Description); Console.WriteLine("HostType: {0}", connMgr.HostType); Console.WriteLine("ID: {0}", connMgr.ID); Console.WriteLine("InnerObject: {0}", connMgr.InnerObject); Console.WriteLine("Name: {0}", connMgr.Name); Console.WriteLine("ProtectionLevel: {0}", connMgr.ProtectionLevel); Console.WriteLine("SupportsDTCTransactions: {0}", connMgr.SupportsDTCTransactions);}
Console.WriteLine("");}
}
}
Error message
Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E} failed due to the following error: 80040154.
Thanks,
Kalam
All Replies
-
Wednesday, June 20, 2007 8:50 AM
I am also facing the same problem. Can anybody help on this?
the Code works fine in a 32 bit machine but shows this on a 64 bit machine.
Any idea?
Thanks in advance
-
Wednesday, June 20, 2007 9:09 AMTry to upload the DTS from a 32 bit machine onto the 64 bit and probably it should work...
-
Thursday, September 13, 2007 7:30 PMCould you elaborate on this solution please ("upload the DTS")? What is involved with uploading DTS onto Windows Vista Business 64-bit? I also get the same error message for a program running in 64-bit mode that is trying to call a 32-bit DLL. Thanks.
-
Thursday, February 21, 2008 7:08 PM
Does any one fighure out the solution to this problem?
-
Monday, February 25, 2008 8:01 PM
Anyone?
-
Tuesday, February 26, 2008 9:58 AMModerator
Hello,
Have a look on
http://support.microsoft.com/kb/175804
and
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2353597&SiteID=1
and
http://support.microsoft.com/kb/931846
I think that's coming from an unregistered class
I try a search in Microsoft.com with 80040154 ( with > 8000 responses )
Have a nice day
-
Wednesday, February 27, 2008 4:58 AM
Thanks for all the responces.I install X86 Package (SQLServer2005_BC.msi) on my production server and now every thing is running fine.
Regards
Anilesh Lakhtakia
-
Monday, April 07, 2008 2:53 AM
I had the same problem. I am using VS2008. There are 2 things one needs to do:
1) Change the configuration from Any CPU to x86
2) Make a new component object with the assembly in Administrative tools - > Component services -> Computers-> My computer ->COM+Applications ->New
-
Monday, April 07, 2008 8:00 AMModerator
Hello,
I found this link :
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=765439&SiteID=1
I hope that will help you
Have a nice day
-
Wednesday, July 09, 2008 1:37 PM
Hello,
this solution helped me alot in solving my 32bit COM dll problem on 64 bit machine (my 32 bit app is running on VS 2005).
thanks a lot.
--RJ
-
Saturday, September 13, 2008 4:05 PM
Thanks Coder001!
I'm also using VS2008 on Vista64. I just had to do your step 1 to fix the problem. I went into Solution Properties-> Compile -> Advanced Compile Options and changed the setting for Target CPU: from "Any CPU" to "x86" and everything is working fine now.
Thanks for your post!
- Proposed As Answer by AbhayBhangale Wednesday, September 01, 2010 9:20 PM
-
Wednesday, January 28, 2009 4:28 PM
I had the same issue with a custom application that was using a 3rd parties dll.
All I had to do was register the DLL using the command line "regsvr32".
In the command window I navigated to where my application was located and contained the DLL.
"regsvr32 AAC_FIREALERT.dll" and press enter. Got a success message and than stopped and started my application. Worked perfectly.
Does this sound like a viable solution?
'Imports AAC_FIREALERTLib 'Argent SDK to post to alert console Public Sub PostToArgentConsole( _ ByVal vUUID As String, _ ByVal vMachine As String, _ ByVal vPriority As String, _ ByVal vRule_name As String, _ ByVal vRelator As String, _ ByVal vConsole_comment As String, _ ByVal vAlert_time As String, _ ByVal vLong_description As String, _ ByVal valert_memo As String, _ ByVal vrequest_server As String, _ ByVal vshort_description As String) 'This sample program shows you how you can use a VB program to interface to the Argent Alert Console. 'Copyright 1991-2004 Argent Software, Inc. 'All Rights Reserved. 'Argent Software, Inc. '24 Orchard View Drive, Londonderry, NH 03053 'For more information: email VB@Argent.com. 'Ensure you have the reference of AAC_FireAlert 1.0 Type library in your project Dim itFire As AAC_FIREALERTLib.IFireAlert Try itFire = New AAC_FIREALERTLib.FireAlert itFire.RuleName = vRule_name itFire.Relator = vRelator itFire.Alerts = "EMAIL_CLT_LTS_EMAIL" itFire.Vendor = "DefenderAlertSVC" itFire.ApplicationName = "Defender" itFire.ConsoleComment = vConsole_comment.ToString.Trim If vPriority = "Low" Then itFire.vPriority = 0 ElseIf vPriority = "Medium" Then itFire.Priority = 1 ElseIf vPriority = "High" Then itFire.Priority = 2 End If itFire.CustomPriorityText = vPriority.ToString.Trim itFire.Server = vMachine.ToString.Trim itFire.AlwaysNotifyConsole = False itFire.BrokenTime = vAlert_time itFire.Summary = vshort_description.ToString.Trim itFire.Detail = vLong_description.ToString.Trim itFire.FireAlert(ConfigurationSettings.AppSettings("AAC_SERVER")) itFire = Nothing 'After posting to Argent, Clear alert from Defender DB AnswerAlert(vUUID) Catch ex As Exception LogIt(Now & " PostToArgentConsole() CONNECTOR ERROR: " & ex.ToString) LogIt(Now & " " & ex.StackTrace.ToString) LogIt(Now & " CONNECTOR ERROR: " & ex.Message.ToString) End Try End Sub - Edited by bdempster Wednesday, January 28, 2009 5:14 PM added code sample
-
Thursday, June 10, 2010 3:18 PMThe easiest way to attack this problem is following the answer Coder 001. At least that worked for me. Good luck
-
Wednesday, September 01, 2010 7:01 PMBingo! Perfect answer! Awesome Dave!
-
Friday, October 29, 2010 8:58 PM
I had the same problem. I am using VS2008. There are 2 things one needs to do:
1) Change the configuration from Any CPU to x86
2) Make a new component object with the assembly in Administrative tools - > Component services -> Computers-> My computer ->COM+Applications ->New
2) Make a new component object with the assembly in Administrative tools - > Component services -> Computers-> My computer ->COM+Applications ->New
Thanks or taking the time to explain this fix...
So I have gone that far...now there are more options...which one do I do?
What is meant by "With the assembly" ?
-
Monday, January 10, 2011 8:14 PM
I recently upgraded my compuetr from Windows XP to Vista (32 bit).
I'm using Visual Studio 2005 SP2.
My application uses a DLL which was also created in Visual Studio 2005 and the DLL is in my project's bin folder.
Everything worked great with this application while on Windows XP. On Windows Vista (32 bit) I get:
"Retrieving the COM class factory for componet with CLSID {D6979A24-6B31-11D5-BA37-00C04F81BC000} failed due to the following error: 80040154.".
All of the answers I've seen on this doesn't seem to apply:
1) Change configuration from All CPU to x86
2) Register the DLL. Tried this and received "Entry-Point DLL Register Server was not found". Never had to register the DLL before
3) Make a new component - Tried this but really didn't know what to do. Nothing on my PC matched any of the previousely poseted comments on this
4) Change component's access.
Please advise.
-
Saturday, January 22, 2011 9:26 PM
I had the same problem. I am using VS2008. There are 2 things one needs to do:
1) Change the configuration from Any CPU to x86
2) Make a new component object with the assembly in Administrative tools - > Component services -> Computers-> My computer ->COM+Applications ->New
Thank you, thank you, thank you. I've been pulling my hair out over this.
-
Monday, March 07, 2011 1:01 PM
Can you please expand on this? It would be of great help to me.
Do you you mean on the target machine or my development machine - I am using a one-click deployment.Cheers
Dan
Dan Towers http://www.baysoftsoftware.co.uk- Edited by DPTowers Monday, March 07, 2011 1:03 PM spelling mistake
-
Wednesday, May 04, 2011 9:22 PM
Coder001 has it right, I'm installing a vendor's web app on a Server 2008 R2, IIS7 bran new server and install, and the app refused to run. Getting an error that the "Retrieving the COM class factory for componen... failed due to the following error: 80040154". Changed it to use the classic app pool, but that alone didn't fix it. The app did start working immediately after creating a new Com+ Application with the application assemblies. Restart IIS, and BAM! it's working.
I only have an idea of why this fixed it, but not completely sure.
I do know that this should have been included in the IIS7 install instructions delivered with the installer from the Vendor!
THX Coder001
-
Thursday, July 19, 2012 3:32 PM
Also you need to run Visual Studio as Administrator. Right click and Run as administrator.
Thanks,
Shrikant

