Discussion:
0x80040154 - Exception, Interop and 64bit OS.
(too old to reply)
n***@lenzing.com
2007-09-25 14:45:46 UTC
Permalink
I have two server

Server A) Production Server with Windows 2k3 64Bit + Comos
Server B) Development Server with Windows 2k3 32 Bit + Visual Studio
2005 + Comos

Comos is the software where the dll is from.

With the command on Server A)
TlbImp "C:\Program Files (x86)\Comos\ocx\comos.dll" /out:Plt.dll i
created a Interop - Assembly

On the Server B) I developed and tested the application with the comos
- Application and the interop worked fine

Now I went back to Server A but here this excepetion was raised:

Retrieving the COM class factory for component with CLSID {3BDD1BA3-
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error:
80040154. System.Runtime.InteropServices.COMException (0x80040154):
Retrieving the COM class factory for component with CLSID {3BDD1BA3-
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error:
80040154.
at LagComosLib.Comos.Init()

Is there a possibility for the Interop - Assembly to use only the name
not the guid, and still use an interop assembly?
n***@lenzing.com
2007-09-25 15:08:03 UTC
Permalink
I found out, on my the server b) the clsid is in HKEY_CLASSES_ROOT
\wow6432Node\CLSID
and no server a) the clsid is in HKEY_CLASSES_ROOT\CLSID

=> Because I had some troubles with my caspol I know that my dotnet
applikation uses the 64 - Bit - Framework
=> Could it that it tries to use the dll as a 64bit and not as a 32
Bit ?
=> How could i prevent this?
=> How can I start an applications as an 32bit - Version
Purrer Wolfgang
2007-09-25 15:23:54 UTC
Permalink
I found an answer:

At first i switched the target plattform form the one assembly to x86,
than this error popped up.

Unhandled Exception: System.BadImageFormatException: Could not load
file or asse
mbly 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' or one
of its dependencies. An attempt was made to load a program with an
incorrect fo
rmat.
File name: 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'
at Strasse7.Strasse7.Main(String[] args)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM
\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software
\Microsoft\Fus
ion!EnableLog].

After this I switched all the assemblies and exe in my project to x86
and it worked!

Just to write it down helped to solve the problem by myself => thanks
folks!
unknown
2009-12-12 16:18:36 UTC
Permalink
Dear Purrer Wolfgang ,

Many thanks for your post. I has certainly helped me today!

Adam



Purrer Wolfgang wrote:

Re: 0x80040154 - Exception, Interop and 64bit OS.
25-Sep-07

I found an answer

At first i switched the target plattform form the one assembly to x86
than this error popped up

Unhandled Exception: System.BadImageFormatException: Could not loa
file or ass
mbly 'LagComosLib, Version=0.0.0.0, Culture=neutral
PublicKeyToken=null' or on
of its dependencies. An attempt was made to load a program with a
incorrect f
rmat
File name: 'LagComosLib, Version=0.0.0.0, Culture=neutral
PublicKeyToken=null
at Strasse7.Strasse7.Main(String[] args

WRN: Assembly binding logging is turned OFF
To enable assembly bind failure logging, set the registry value [HKL
\Software\
icrosoft\Fusion!EnableLog] (DWORD) to 1
Note: There is some performance penalty associated with assembly bin
failure l
gging
To turn this feature off, remove the registry value [HKLM\Softwar
\Microsoft\Fu
ion!EnableLog]

After this I switched all the assemblies and exe in my project to x8
and it worked

Just to write it down helped to solve the problem by myself => thank
folks!

Previous Posts In This Thread:

On Tuesday, September 25, 2007 10:45 AM
ng.w.purre wrote:

0x80040154 - Exception, Interop and 64bit OS.
I have two serve

Server A) Production Server with Windows 2k3 64Bit + Como
Server B) Development Server with Windows 2k3 32 Bit + Visual Studi
2005 + Como

Comos is the software where the dll is from

With the command on Server A
TlbImp "C:\Program Files (x86)\Comos\ocx\comos.dll" /out:Plt.dll
created a Interop - Assembl

On the Server B) I developed and tested the application with the como
- Application and the interop worked fin

Now I went back to Server A but here this excepetion was raised

Retrieving the COM class factory for component with CLSID {3BDD1BA3
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error
80040154. System.Runtime.InteropServices.COMException (0x80040154)
Retrieving the COM class factory for component with CLSID {3BDD1BA3
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error
80040154
at LagComosLib.Comos.Init(

Is there a possibility for the Interop - Assembly to use only the nam
not the guid, and still use an interop assembly?

On Tuesday, September 25, 2007 11:08 AM
ng.w.purre wrote:

I found out, on my the server b) the clsid is in
I found out, on my the server b) the clsid is in HKEY_CLASSES_ROO
\wow6432Node\CLSI
and no server a) the clsid is in HKEY_CLASSES_ROOT\CLSI

=> Because I had some troubles with my caspol I know that my dotne
applikation uses the 64 - Bit - Framewor
=> Could it that it tries to use the dll as a 64bit and not as a 3
Bit
=> How could i prevent this
=> How can I start an applications as an 32bit - Version

On Tuesday, September 25, 2007 11:23 AM
Purrer Wolfgang wrote:

Re: 0x80040154 - Exception, Interop and 64bit OS.
I found an answer

At first i switched the target plattform form the one assembly to x86
than this error popped up

Unhandled Exception: System.BadImageFormatException: Could not loa
file or ass
mbly 'LagComosLib, Version=0.0.0.0, Culture=neutral
PublicKeyToken=null' or on
of its dependencies. An attempt was made to load a program with a
incorrect f
rmat
File name: 'LagComosLib, Version=0.0.0.0, Culture=neutral
PublicKeyToken=null
at Strasse7.Strasse7.Main(String[] args

WRN: Assembly binding logging is turned OFF
To enable assembly bind failure logging, set the registry value [HKL
\Software\
icrosoft\Fusion!EnableLog] (DWORD) to 1
Note: There is some performance penalty associated with assembly bin
failure l
gging
To turn this feature off, remove the registry value [HKLM\Softwar
\Microsoft\Fu
ion!EnableLog]

After this I switched all the assemblies and exe in my project to x8
and it worked

Just to write it down helped to solve the problem by myself => thank
folks!


Submitted via EggHeadCafe - Software Developer Portal of Choice
A Developer's Guide To SQL Server Profiler
http://www.eggheadcafe.com/tutorials/aspnet/7da853a3-ffd5-4c76-91d8-ce1600d6db80/a-developers-guide-to-sq.aspx
unknown
2009-12-12 16:19:20 UTC
Permalink
Dear Purrer,

Many thanks for your post. It saved my day.



Purrer Wolfgang wrote:

Re: 0x80040154 - Exception, Interop and 64bit OS.
25-Sep-07

I found an answer:

At first i switched the target plattform form the one assembly to x86,
than this error popped up.

Unhandled Exception: System.BadImageFormatException: Could not load
file or asse
mbly 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' or one
of its dependencies. An attempt was made to load a program with an
incorrect fo
rmat.
File name: 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'
at Strasse7.Strasse7.Main(String[] args)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM
\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software
\Microsoft\Fus
ion!EnableLog].

After this I switched all the assemblies and exe in my project to x86
and it worked!

Just to write it down helped to solve the problem by myself => thanks
folks!

Previous Posts In This Thread:

On Tuesday, September 25, 2007 10:45 AM
ng.w.purre wrote:

0x80040154 - Exception, Interop and 64bit OS.
I have two server

Server A) Production Server with Windows 2k3 64Bit + Comos
Server B) Development Server with Windows 2k3 32 Bit + Visual Studio
2005 + Comos

Comos is the software where the dll is from.

With the command on Server A)
TlbImp "C:\Program Files (x86)\Comos\ocx\comos.dll" /out:Plt.dll i
created a Interop - Assembly

On the Server B) I developed and tested the application with the comos
- Application and the interop worked fine

Now I went back to Server A but here this excepetion was raised:

Retrieving the COM class factory for component with CLSID {3BDD1BA3-
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error:
80040154. System.Runtime.InteropServices.COMException (0x80040154):
Retrieving the COM class factory for component with CLSID {3BDD1BA3-
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error:
80040154.
at LagComosLib.Comos.Init()

Is there a possibility for the Interop - Assembly to use only the name
not the guid, and still use an interop assembly?

On Tuesday, September 25, 2007 11:08 AM
ng.w.purre wrote:

I found out, on my the server b) the clsid is in
I found out, on my the server b) the clsid is in HKEY_CLASSES_ROOT
\wow6432Node\CLSID
and no server a) the clsid is in HKEY_CLASSES_ROOT\CLSID

=> Because I had some troubles with my caspol I know that my dotnet
applikation uses the 64 - Bit - Framework
=> Could it that it tries to use the dll as a 64bit and not as a 32
Bit ?
=> How could i prevent this?
=> How can I start an applications as an 32bit - Version

On Tuesday, September 25, 2007 11:23 AM
Purrer Wolfgang wrote:

Re: 0x80040154 - Exception, Interop and 64bit OS.
I found an answer:

At first i switched the target plattform form the one assembly to x86,
than this error popped up.

Unhandled Exception: System.BadImageFormatException: Could not load
file or asse
mbly 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' or one
of its dependencies. An attempt was made to load a program with an
incorrect fo
rmat.
File name: 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'
at Strasse7.Strasse7.Main(String[] args)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM
\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software
\Microsoft\Fus
ion!EnableLog].

After this I switched all the assemblies and exe in my project to x86
and it worked!

Just to write it down helped to solve the problem by myself => thanks
folks!

On Saturday, December 12, 2009 11:18 AM
Adam Armstrong wrote:

0x80040154 - Exception, Interop and 64bit OS.
Dear Purrer Wolfgang ,

Many thanks for your post. I has certainly helped me today!

Adam


Submitted via EggHeadCafe - Software Developer Portal of Choice
.NET 2.0 Generics - Load A Business Class In A Clueless Database Layer
http://www.eggheadcafe.com/tutorials/aspnet/2187d05c-7d8a-4f6e-9f24-9f4ac5bd8679/net-20-generics--load.aspx
unknown
2010-04-20 10:42:38 UTC
Permalink
Hi,

I have this error when I try to use Sybase Ase on Windows 2008 :

Top Level Exception:

System.TypeInitializationException: The type initializer for 'Sybase.Data.AseClient.AseConnection' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at ?.AseGetDriverVersion(StringBuilder A_0, Int32 A_1)
at Sybase.Data.AseClient.AseConnection.?()

Do you have any idea ?
Thanks,
AH



Adam Armstrong wrote:

0x80040154 - Exception, Interop and 64bit OS.
12-Dec-09

Dear Purrer,

Many thanks for your post. It saved my day.

Previous Posts In This Thread:

On Tuesday, September 25, 2007 10:45 AM
ng.w.purre wrote:

0x80040154 - Exception, Interop and 64bit OS.
I have two serve

Server A) Production Server with Windows 2k3 64Bit + Como
Server B) Development Server with Windows 2k3 32 Bit + Visual Studi
2005 + Como

Comos is the software where the dll is from

With the command on Server A
TlbImp "C:\Program Files (x86)\Comos\ocx\comos.dll" /out:Plt.dll
created a Interop - Assembl

On the Server B) I developed and tested the application with the como
- Application and the interop worked fin

Now I went back to Server A but here this excepetion was raised

Retrieving the COM class factory for component with CLSID {3BDD1BA3
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error
80040154. System.Runtime.InteropServices.COMException (0x80040154)
Retrieving the COM class factory for component with CLSID {3BDD1BA3
E09C-11CF-9BB7-00A0248A9BEE} failed due to the following error
80040154
at LagComosLib.Comos.Init(

Is there a possibility for the Interop - Assembly to use only the nam
not the guid, and still use an interop assembly?

On Tuesday, September 25, 2007 11:08 AM
ng.w.purre wrote:

I found out, on my the server b) the clsid is in
I found out, on my the server b) the clsid is in HKEY_CLASSES_ROO
\wow6432Node\CLSI
and no server a) the clsid is in HKEY_CLASSES_ROOT\CLSI

=> Because I had some troubles with my caspol I know that my dotne
applikation uses the 64 - Bit - Framewor
=> Could it that it tries to use the dll as a 64bit and not as a 3
Bit
=> How could i prevent this
=> How can I start an applications as an 32bit - Version

On Tuesday, September 25, 2007 11:23 AM
Purrer Wolfgang wrote:

Re: 0x80040154 - Exception, Interop and 64bit OS.
I found an answer

At first i switched the target plattform form the one assembly to x86
than this error popped up

Unhandled Exception: System.BadImageFormatException: Could not loa
file or ass
mbly 'LagComosLib, Version=0.0.0.0, Culture=neutral
PublicKeyToken=null' or on
of its dependencies. An attempt was made to load a program with a
incorrect f
rmat
File name: 'LagComosLib, Version=0.0.0.0, Culture=neutral
PublicKeyToken=null
at Strasse7.Strasse7.Main(String[] args

WRN: Assembly binding logging is turned OFF
To enable assembly bind failure logging, set the registry value [HKL
\Software\
icrosoft\Fusion!EnableLog] (DWORD) to 1
Note: There is some performance penalty associated with assembly bin
failure l
gging
To turn this feature off, remove the registry value [HKLM\Softwar
\Microsoft\Fu
ion!EnableLog]

After this I switched all the assemblies and exe in my project to x8
and it worked

Just to write it down helped to solve the problem by myself => thank
folks!

On Saturday, December 12, 2009 11:18 AM
Adam Armstrong wrote:

0x80040154 - Exception, Interop and 64bit OS.
Dear Purrer Wolfgang ,

Many thanks for your post. I has certainly helped me today!

Adam

On Saturday, December 12, 2009 11:19 AM
Adam Armstrong wrote:

0x80040154 - Exception, Interop and 64bit OS.
Dear Purrer,

Many thanks for your post. It saved my day.


Submitted via EggHeadCafe - Software Developer Portal of Choice
Using VSTO Add-In To Automate Frequent Excel 2007 Tasks
http://www.eggheadcafe.com/tutorials/aspnet/ff2d1d4b-aedf-4d14-9e60-39a86ccab5d6/using-vsto-addin-to-auto.aspx
Jack United
2011-02-09 01:51:12 UTC
Permalink
Hi Purrer,

I have a web application which is using a 32bit DLL. When you say, "switched the target plattform form the one assembly to x86", how do you do that?

Cheers,
Jack
Post by n***@lenzing.com
I have two server
Server A) Production Server with Windows 2k3 64Bit + Comos
Server B) Development Server with Windows 2k3 32 Bit + Visual Studio
2005 + Comos
Comos is the software where the dll is from.
With the command on Server A)
TlbImp "C:\Program Files (x86)\Comos\ocx\comos.dll" /out:Plt.dll i
created a Interop - Assembly
On the Server B) I developed and tested the application with the comos
- Application and the interop worked fine
Retrieving the COM class factory for component with CLSID {3BDD1BA3-
Retrieving the COM class factory for component with CLSID {3BDD1BA3-
80040154.
at LagComosLib.Comos.Init()
Is there a possibility for the Interop - Assembly to use only the name
not the guid, and still use an interop assembly?
Post by n***@lenzing.com
I found out, on my the server b) the clsid is in HKEY_CLASSES_ROOT
\wow6432Node\CLSID
and no server a) the clsid is in HKEY_CLASSES_ROOT\CLSID
=> Because I had some troubles with my caspol I know that my dotnet
applikation uses the 64 - Bit - Framework
=> Could it that it tries to use the dll as a 64bit and not as a 32
Bit ?
=> How could i prevent this?
=> How can I start an applications as an 32bit - Version
Post by Purrer Wolfgang
At first i switched the target plattform form the one assembly to x86,
than this error popped up.
Unhandled Exception: System.BadImageFormatException: Could not load
file or asse
mbly 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null' or one
of its dependencies. An attempt was made to load a program with an
incorrect fo
rmat.
File name: 'LagComosLib, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'
at Strasse7.Strasse7.Main(String[] args)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM
\Software\M
icrosoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind
failure lo
gging.
To turn this feature off, remove the registry value [HKLM\Software
\Microsoft\Fus
ion!EnableLog].
After this I switched all the assemblies and exe in my project to x86
and it worked!
Just to write it down helped to solve the problem by myself => thanks
folks!
Post by unknown
Dear Purrer Wolfgang ,
Many thanks for your post. I has certainly helped me today!
Adam
Post by unknown
Dear Purrer,
Many thanks for your post. It saved my day.
Post by unknown
Hi,
System.TypeInitializationException: The type initializer for 'Sybase.Data.AseClient.AseConnection' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at ?.AseGetDriverVersion(StringBuilder A_0, Int32 A_1)
at Sybase.Data.AseClient.AseConnection.?()
Do you have any idea ?
Thanks,
AH
Submitted via EggHeadCafe
Excel JSON Storing Data
http://www.eggheadcafe.com/tutorials/aspnet/233e58b3-72f4-4220-8d45-37c2c44e795e/excel-json-storing-data.aspx
Loading...