web-configclrapp-config.net-4.5corflags

Prefer32Bit Flag on project file


When changing a project from targeting .NET 4 to .NET 4.5 I get the following added to the project file for each build configuration:

<Prefer32Bit>false</Prefer32Bit>

What does this mean? The only documentation I could find on MSDN wasn't too clear.


Solution

  • Sets the 32BITPREFERRED flag. The app runs as a 32-bit process even on 64-bit platforms. Set this flag only on EXE files. If the flag is set on a DLL, the DLL fails to load in 64-bit processes, and a BadImageFormatException exception is thrown. An EXE file with this flag can be loaded into a 64-bit process. New in the .NET Framework 4.5.

    From the Corflags documentation

    http://msdn.microsoft.com/en-us/library/ms164699.aspx