c# – can I switch to 64bit – Education Career Blog

Hi
My software is for 32 bit version , but if I switch to 64 bit version (in VS 2008) , does it make any problem on running ?

,

If it is pure .Net you can set it to AnyCPU, then it will work in 64bit mode if the OS is 64bit.

The problems may arise when you are using external unmanaged libraries or COM objects with Interop.

,

64 bit Windows can run 32 bit programs, so even if some of your users are on 64 bit Windows you don’t have to do anything.

If you want to target 64 bit Windows but still have users on 32 bit Windows then you will need to create two separate versions of the program, one for each.

32 bit Windows cannot run 64 bit programs.

,

It will depend on the kind of features you are using in the .NET plateform. As far as I know, the main problems seem to be located around interop and marshaling, so if you are not using native dll you will propably be safe.

Take a look at your third party components documentations to see if they report any kind of issues when migrating.

,

Most programs designed for the 32-bit version will work on the 64-bit version. The “Most” comes for people using system specific things specific for 32 bit in a 64 version.

For example trying to access Regsvr32.exe you might face an error like :

“Filename.dll is not an executable
file and no registration helper is
registered for this file type.”

Which has workarounds of course (…google it out). But other than that you are on the run.

,

Some things do behave differently when run on a 64bit system even if you only use .Net code. I’ve had problems in the past with the print dialog box with windows 64bit. However the issues that come up are only small.

,

If the code lacks any “unsafe” tags, and is only .NET without any extra interop, then it should easily be able to be compiled for x64 no questions asked.

Leave a Comment