Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running an AnyCPU application as 32-bit on a 64-bit OS

Is there a way to execute a .NET application compiled under AnyCPU as a 32-bit application when running in a 64-bit Windows environment without recompiling as x86?

like image 257
statenjason Avatar asked Jul 02 '09 16:07

statenjason


People also ask

Can you run 32-bit applications on a 64-bit operating system?

Backward compatibility is an important part when it comes to computer technology. Therefore, 64 bit systems can support and run 32-bit applications.

How do I make my 64-bit application 32-bit?

Replies (1)  Not possible, you need to check the developers website then download the 32 bit version of the software you need to install. Most developers will have both architectures on their site. If not, then you will need to switch to a 64 bit version of Windows 7 or Windows 10 if your system supports it.

Can 32-bit programs run faster on a 64-bit?

Short answer, yes. In general any 32 bit program runs slightly faster than a 64 bit program on a 64 bit platform, given the same CPU.

Is it better to run 32-bit on 64-bit?

Simply put, a 64-bit processor is more capable than a 32-bit processor because it can handle more data at once. A 64-bit processor can store more computational values, including memory addresses, which means it can access over 4 billion times the physical memory of a 32-bit processor.


2 Answers

You can use corflags with the /32bit+ option.

like image 115
Jonathan Rupp Avatar answered Jan 02 '23 06:01

Jonathan Rupp


You can use CorFlags to change the bit without compiling, but you need to modify the application itself to run it. There is no way to just run the app as 32bit directly.

Alternatively, if you do not want to change the .exe at all, you can make a 32bit compiled application that loads the assembly and starts its entry point. Since you're loading the assembly into a running 32bit application, it will run as 32bit.

like image 45
Reed Copsey Avatar answered Jan 02 '23 06:01

Reed Copsey