Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Out of curiosity, why would you want to? –  Ryan Bolger Sep 24 '09 at 20:47
    
Some drivers are only available in 32 bit versions - and if the app runs as a 64 bit app, it likely won't be able to see them or use them. Since this particular app can run safely as either 32 or 64 bits, I'm trying to figure out if I can force it to run as a 32 bit app and access a better list of drivers. –  blueberryfields Sep 24 '09 at 21:08
    
Can this be migrated to stackOverflow? –  setatakahashi Sep 24 '09 at 23:37
    
Good idea; voted to migrate –  Darth Satan Sep 25 '09 at 8:51

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.