Home All Groups Group Topic Archive Search About

System.BadImageFormatException

Author
19 Oct 2006 8:37 PM
Glenn Palomar
Hi,

I have VB.net application that I recently migrated from VS2003 to VS2005. It
works fine in Windows XP and 2K but NOT in XP64.

I get an exception error that says System.BadImageFormatException. I checked
the Advanced Compliler Settings and the Target CPU is set to AnyCPU. Setting
it x64 does not make a difference.

If I run my previous copy of the application built in VS2003 on the x64
system, it runs ok.

Any ideas?

Thanks,
Glenn

Author
20 Oct 2006 11:12 AM
Robinson
Show quote Hide quote
> I have VB.net application that I recently migrated from VS2003 to VS2005.
> It works fine in Windows XP and 2K but NOT in XP64.
>
> I get an exception error that says System.BadImageFormatException. I
> checked the Advanced Compliler Settings and the Target CPU is set to
> AnyCPU. Setting it x64 does not make a difference.
>
> If I run my previous copy of the application built in VS2003 on the x64
> system, it runs ok.
>
> Any ideas?




Strange - I posted about this very issue just a few posts above with no
response so far.  I recently tried migrating my 2003 project to 2005 and I
get the same thing from one of the projects in the solution.  It's an x64
system, but 32 bit Windows.

I would love to know either what causes this, the solution or where best to
look for the solution.




Robin
Author
20 Oct 2006 9:14 PM
Glenn Palomar
Hi Robin,

I found the solution to my problem. I needed to change the Target CPU from
"AnyCPU" to "x86" under Advanced Compiler Settings.

See if this will work for you.

Glenn

Show quoteHide quote
"Robinson" <toomuchspamhaspassed@myinboxtoomuchtoooften.com> wrote in
message news:ehaaus$6r9$1$8302bc10@news.demon.co.uk...
>> I have VB.net application that I recently migrated from VS2003 to VS2005.
>> It works fine in Windows XP and 2K but NOT in XP64.
>>
>> I get an exception error that says System.BadImageFormatException. I
>> checked the Advanced Compliler Settings and the Target CPU is set to
>> AnyCPU. Setting it x64 does not make a difference.
>>
>> If I run my previous copy of the application built in VS2003 on the x64
>> system, it runs ok.
>>
>> Any ideas?
>
>
>
>
> Strange - I posted about this very issue just a few posts above with no
> response so far.  I recently tried migrating my 2003 project to 2005 and I
> get the same thing from one of the projects in the solution.  It's an x64
> system, but 32 bit Windows.
>
> I would love to know either what causes this, the solution or where best
> to look for the solution.
>
>
>
>
> Robin
>
Author
23 Oct 2006 10:09 AM
Robinson
Hi, checked it this morning, switched to x86 and still getting
BadImageFormat exception when I try to run the program in the debugger.  I'm
a bit miffed to say the least.....




Show quoteHide quote
"Glenn Palomar" <glenn.palo***@autodesk.com> wrote in message
news:OSv2syI9GHA.4288@TK2MSFTNGP02.phx.gbl...
> Hi Robin,
>
> I found the solution to my problem. I needed to change the Target CPU from
> "AnyCPU" to "x86" under Advanced Compiler Settings.
>
> See if this will work for you.
>
> Glenn
>
> "Robinson" <toomuchspamhaspassed@myinboxtoomuchtoooften.com> wrote in
> message news:ehaaus$6r9$1$8302bc10@news.demon.co.uk...
>>> I have VB.net application that I recently migrated from VS2003 to
>>> VS2005. It works fine in Windows XP and 2K but NOT in XP64.
>>>
>>> I get an exception error that says System.BadImageFormatException. I
>>> checked the Advanced Compliler Settings and the Target CPU is set to
>>> AnyCPU. Setting it x64 does not make a difference.
>>>
>>> If I run my previous copy of the application built in VS2003 on the x64
>>> system, it runs ok.
>>>
>>> Any ideas?
>>
>>
>>
>>
>> Strange - I posted about this very issue just a few posts above with no
>> response so far.  I recently tried migrating my 2003 project to 2005 and
>> I get the same thing from one of the projects in the solution.  It's an
>> x64 system, but 32 bit Windows.
>>
>> I would love to know either what causes this, the solution or where best
>> to look for the solution.
>>
>>
>>
>>
>> Robin
>>
>
>
Author
23 Oct 2006 11:26 AM
Robinson
Actually I managed to get one to compile x86 and the program runs, but it
fails when it loads one of my libraries - I switched it's project properties
to x86, but it still seems to insist on building it "AnyCPU" regardless of
what I do! ARGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.

I've almost given up on the conversion to be honest.   :/

Show quoteHide quote
"Robinson" <toomuchspamhaspassed@myinboxtoomuchtoooften.com> wrote in
message news:ehi4dn$778$1$8300dec7@news.demon.co.uk...
>
> Hi, checked it this morning, switched to x86 and still getting
> BadImageFormat exception when I try to run the program in the debugger.
> I'm a bit miffed to say the least.....
>
>
>
>
> "Glenn Palomar" <glenn.palo***@autodesk.com> wrote in message
> news:OSv2syI9GHA.4288@TK2MSFTNGP02.phx.gbl...
>> Hi Robin,
>>
>> I found the solution to my problem. I needed to change the Target CPU
>> from "AnyCPU" to "x86" under Advanced Compiler Settings.
>>
>> See if this will work for you.
>>
>> Glenn
>>
>> "Robinson" <toomuchspamhaspassed@myinboxtoomuchtoooften.com> wrote in
>> message news:ehaaus$6r9$1$8302bc10@news.demon.co.uk...
>>>> I have VB.net application that I recently migrated from VS2003 to
>>>> VS2005. It works fine in Windows XP and 2K but NOT in XP64.
>>>>
>>>> I get an exception error that says System.BadImageFormatException. I
>>>> checked the Advanced Compliler Settings and the Target CPU is set to
>>>> AnyCPU. Setting it x64 does not make a difference.
>>>>
>>>> If I run my previous copy of the application built in VS2003 on the x64
>>>> system, it runs ok.
>>>>
>>>> Any ideas?
>>>
>>>
>>>
>>>
>>> Strange - I posted about this very issue just a few posts above with no
>>> response so far.  I recently tried migrating my 2003 project to 2005 and
>>> I get the same thing from one of the projects in the solution.  It's an
>>> x64 system, but 32 bit Windows.
>>>
>>> I would love to know either what causes this, the solution or where best
>>> to look for the solution.
>>>
>>>
>>>
>>>
>>> Robin
>>>
>>
>>
>
>