7

I have a .Net application, compiled with the "Any" flag set for the architecture type.

I am wondering if it is possible to force the application to run as a 32 bit application, on a(any) 64 bit version of windows, without recompiling the application into a 32 bit executable.

blueberryfields
  • 757
  • 1
  • 7
  • 17

1 Answers1

9

Yes, if you set the project properties to use 32-bit (x86 I think) explicitly it will always run in that mode. We had that issue when using the SQLite ADO.Net provider (it was looking for the 32-bit version only, which couldn't load when run on a x64 system).

You can use corflags to set the 32-bit bit (ha ha) flag on the executable. Here is an example. In short, you'll run:

corflags /32BIT+ assembly.exe-or.dll

You'll find corflags.exe installed with the SDK with Visual Studio (installed in C:\Program Files\Microsoft SDK\6.0a or 7.0\bin) or you can get it from the the Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1.

Joshua
  • 1,546
  • 1
  • 13
  • 16