DirectX BadImageFormatExceptions

Hi all,

i try to compile and run my solutions with Visual c# 2005 Express on Windows XP Pro 64bit. Which works fine on my Windows Xp Pro machine, but throws BadImageFormatExceptions on my 64bit OS. I tried DirectX and SDL .NET... it seems like the DLLs are not valid... cant find any help on MSDN or on the net. Please help me!
Thanks, Marre

[353 byte] By [MarioMarschner] at [2008-2-19]
# 1

From http://msdn.microsoft.com/directx/sdk/readmepage/default.aspx:
There is no support for installing the DirectX 9.0 SDK on IA64 bit platforms.

IIRC, this platform will be supported in November, when VS2005 is released.

DanielRieck at 2007-9-9 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....
# 2
Mario:

The likely reason for the BadImageFormatException is that you are compiling your project as "Any CPU" or agnostic and it is running against the CLR64. The DirectX dependencies are 32bit assemblies, so that will fail to load.

To correct this issue you will need to build your project for "X86". To do this create a new Platform type for X86.

Build -> Configuration Manager
In "Active solution manager" select "<new>"
Select "X86" in "Type or select new platform"
Set "Copy settings from" to "Any CPU"
Check "create new project platforms"
OK

This will force your application to run under the WOW64.

Hope that this helps.

Jeff

JeffSchwartzmsft at 2007-9-9 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....
# 3
I half understand what is happening here, but would like to understand the other half so I can avoid problems in the future.

What makes an assembly require the x86 framework? No assembly I have created seems to require this.

Also, is there a config file setting that can cause an assembly which was compiled agnostically to run properly?

Gabe19 at 2007-9-9 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....
# 4
I have some useful resources published on the following website ,

maybe it can help you.

Good Luck!

cindyding0412 at 2007-9-9 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....

.NET Development

Site Classified