CorFlags , , .
, exe Prefer 32 bit, . , , , 64- , ( - OLEDB). (, 64- , 32-) - , , . - cmd script, ( exe ConsoleApplication3.exe):
:start
start /wait "" "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\CorFlags.exe" ConsoleApplication3.exe /32BIT+
if errorlevel 1 (
goto start
)
start "" ConsoleApplication3.exe
, , - , , . script , exe, CorFlags 32- , exe.
:
static void Main() {
if (Environment.Is64BitProcess) {
Console.WriteLine("Running in 64-bit mode. Press any key to fix");
Console.ReadKey();
var process = new Process() {
StartInfo = new ProcessStartInfo("cmd.exe", "/c call fix-mode.cmd")
};
process.Start();
}
else {
Console.WriteLine("Running in 32bit mode");
}
}
, (CorFlags) Visual Studio, ( ).