[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4200
  • Last Modified:

How to compile a 32-bit vb.net program to run in a 64-bit Windows 7?

Hello,

I have Visual Studio 2010 in a 32-bit Windows 7. I need to compile my created vb.net program (.exe) to be able to run in a 64-bit Windows 7 environment.

What should I setup in my VS2010 in order to accomplish that?

Thanks
0
miyahira
Asked:
miyahira
3 Solutions
 
pgm554Commented:
Do you need to run the app as 64 bit?
Are you writing a device driver?
32 bit app should work fine in WOW64.

Unless you actually need the >4gb address space,not really a need in most instances.

FYI ,M$ still recommends 32 bit office over 64 bit edition even on 64 bit Windows.
0
 
Easwaran ParamasivamCommented:
While compiling the project, set the target platform option a x86 (for 32 bit) or x64 (for 64 bit).  Then it would run fine in the target machine.

For more information please look at: http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/
0
 
käµfm³d 👽Commented:
You should only need to explicitly set the project to x86 if your application is dependent on  libraries that were compiled to run as a specific architecture (like Oracle data access libraries). Setting your project to "Any CPU" should work fine, otherwise.
0
 
miyahiraAuthor Commented:
I have set my VS2010 project to "Any CPU" and even so my program doesn't run on a 64-bit Windows 7. However, it does on a 32-bit Windows 7.

Could be it possible it's because I'm using System.Data.OracleClient for database connection?

Error message in 64-bit Windows 7:

"The version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher"

The 64-bit Windows 7 has Framework v2 installed. I attach some picture to show that.

Supposedly, WOW64 should run automatically but will not work on all applications.

In this case, should I install on my 64-bit Windows 7 some "Windows virtual PC"? Any further advice on how to do that would be appreciate.
64-bit-windows-7.png
0
 
käµfm³d 👽Commented:
System.Data.OracleClient is the Microsoft-provided Oracle provider. I don't recall ever having issues with that particular library with regard to 32- vs. 64-bit.

Be aware that this provider is actually deprecated, and it could be removed in a future version of .NET.

i.e.  (http://msdn.microsoft.com/en-us/library/system.data.oracleclient(v=vs.110).aspx)

This types in System.Data.OracleClient are deprecated and will be removed in a future version of the .NET Framework.

The preferred way to connect to Oracle is by using Oracle's own providers:  ODAC. With ODAC, you do have to explicitly compile for a specific bitness.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now