Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a program written in VB that installs and runs correctly on XP and W7/32, but behaves very strangely on W7/64. If I install it, the install goes cleanly but when I attempt to run it, it fails with a BadImageFormatException on one of it's DLLs. If I copy it from a flash drive into a directory on the W7/64 machine,it runs without error and produces correct results!

It is not the CPU type: this is set to x86 on all projects within the program.

It must have something to do with the install process.

Does anyone have any useful ideas?
Posted
Comments
Richard C Bishop 10-Apr-13 16:25pm    
I don't have any suggestions for your application issue, but I must say your screen name is the best I have seen.
Sergey Alexandrovich Kryukov 10-Apr-13 16:55pm    
I do have some suggestions (please see my answer), but don't see anything special in the name. :-)
—SA
Jalapeno Bob 10-Apr-13 17:16pm    
I thought of using a chili pepper for an avatar, but Chili's Grill and Bar might not be happy with that.....

1 solution

Please check up that all your modules are compiled to the target instruction-set architecture "AnyCPU" and you don't have any native (non-managed) modules. If you do have some, you would need to provide a mechanism for loading alternative implementations for different instruction-set architectures, such as x86-64 or Itanium (IE-64). This is how native modules of OS work: on a different version of OS, you have the same but API compiled to the instruction-set architecture used on this system.

Alternatively, you can use all modules in x86, which is supported via WoW64: http://en.wikipedia.org/wiki/WOW64[^].

In this case, you should make sure that you don't have a mixture of different instruction-set architectures in one process (different processes, naturally, can run in different platforms, WoW64 and the one native on the version of the OS. Again, make sure your native (non-managed) modules are consistent.

Generally, you need to have everything built to "AnyCPU", but, it working on WoW64 or any specific instruction-set architecture is important by some reason (which is always related to the unmanaged modules), and only the entry-point assembly should define a particular architecture.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900