I've been told there is an environment variable you can set to force .NET applications to run as 32bit applications on x64 versions of Windows. Do you know what it is, or know of a reference on it? I'm afraid my google-fu has failed me today (or it doesn't exist).
I'm using Resolver One (a .NET spreadsheet) and want to access some 32bit only functionality without modifying the executable. If I can configure this from an environment variable then I can access 32bit functionality when needed but also run as a 64bit app when needed.
(NOTE: effectively I want to be able to switch whether an application runs as 32bit or 64bit at launch time instead of forcing it at compile time.)
Thanks
Drop the application "corflags.exe" into the \windows\system32 folder. Open a command line as administrator and type... This will force the application to run as a 32-bit process instead of 64-bit. This edits the executable file though.
WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows. This allows for 32-bit (x86) Windows applications to run seamlessly in 64-bit (x64) Windows, as well as for 32-bit (x86) and 32-bit (ARM) Windows applications to run seamlessly in 64-bit (ARM64) Windows.
The 64-bit versions of Windows don't provide support for 16-bit binaries or 32-bit drivers. Programs that depend on 16-bit binaries or 32-bit drivers can't run on the 64-bit versions of Windows unless the program manufacturer provides an update for the program.
In Visual Studio 2019 right-click your project, choose Properties . In the project properties window, select the Debug tab. Then, under Environment variables change the value of your environment from Development to Production or other environments.
I've had an answer from Dino Veihland (Microsoft IronPython developer). I haven't had time to test it yet...
It's COMPLUS_ENABLE_64BIT. I think setting it to 0 disables 64-bit.
You should be able to set it as an env var or add a value to HKLM\Software\Microsoft\.NETFramework with the name "Enable_64Bit", the type REG_DWORD and the value 0 to set it globally (this is how all the COMPlus_* vars work). This one might be special enough (it has to run before the process is created) that it has to be set in the reg key but I'm not entirely certain.
How about this link
Not quite an environment variable, but just use the CoreFlags tool to switch back and forth.
To switch to 32 bit:
CorFlags.exe TheApp.exe /32BIT+
To go back to 64 bit:
CorFlags.exe TheApp.exe /32BIT-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With