an attempt was made to load a program with an incorrect format

  • Thread starter Thread starter Scott Baxter
  • Start date Start date
S

Scott Baxter

Hello,

This is the error I get on Windows 7.

I tried going to the project screen in vb.net Studio 2008, and changing the
target cpu to x64. This did not work.

Do I have to build the program on Windows 7?


I'm sure this must be a common problem for programs going to Windows 7.

Thanks for any help.

Scott
 
Hello,

This is the error I get on Windows 7.

I tried going to the project screen in vb.net Studio 2008, and changing the
target cpu to x64.  This did not work.

Do I have to build the program on Windows 7?

I'm sure this must be a common problem for programs going to Windows 7.

Thanks for any help.

Scott

Hi,

I think you need to set target CPU to x86 explicty and re-compile,
then try to run on Win 7 x64:

http://i.msdn.microsoft.com/Bb398791.DropdownBox_VBWAP(en-us,VS.100).png

or try to use corflags utility:
http://blogs.msdn.com/arvindsh/arch...h-an-incorrect-format-net-p-invoke-issue.aspx

HTH,

Onur Güzel
 
Scott said:
Hello,

This is the error I get on Windows 7.

I tried going to the project screen in vb.net Studio 2008, and changing
the target cpu to x64. This did not work.

Do I have to build the program on Windows 7?


I'm sure this must be a common problem for programs going to Windows 7.

Thanks for any help.


The rule of thumb I always follow is develop, compile and build the
application on the platform it's intended to run on. That means you
develop, compile, and build the application on Win 7 64 machine to be
deployed to a Win 7 64 machines -- Windows XP machine to Windows XP
machines, Vista machine to Vista machines, etc. etc.
 
Am 22.05.2010 01:17, schrieb Scott Baxter:
This is the error I get on Windows 7.

I tried going to the project screen in vb.net Studio 2008, and changing
the target cpu to x64. This did not work.

Do I have to build the program on Windows 7?

Are you sure the Windows 7 version of the PC you are trying to run the
application on is the 64-bit version and not the 32-bit (x86) version?
 
Hello D-Someone,

This is unrealistic.

It depends. If you write a mainstream application you cannot ensure that
your app runs on the same OS version as you wrote it on. However, if you
write an app for a special customer (e.g. banks, pharmacy), you might be
lucky enough that they use a very specific OS and then (only then) you
can write this way. If this is not possible and you write mainstream
then you could write for the OS which is used by most users (currently
this would be XP) and at a later time change to the OS which most users
at that time use (e.g. Windows 7).


Doing this has the advantage you you have better control of the layout
on the screen. I once had the problem with a VB6 application which
looked fine under XP (my development system) and ugly (distances did not
match) under Windows Vista.

Best regards,

Martin
 
Not that much.

However, it is impossible to develop a Windows 7 application on Windows 98

While you still can make Windows 98 applications on Windows 7

Cor
 
Cor said:
Not that much.

However, it is impossible to develop a Windows 7 application on Windows 98

While you still can make Windows 98 applications on Windows 7

Cor

Hmmm...i'd love to see that in a development process...maintaining about
a dozen codebases and distributables. And what if a customer upgrades /
downgrades to a different OS?

Test on the expected range of OS's, absolutely. But build and develop
per OS?
 
Back
Top