.NET version with 64-bit or 32-bit assemblies

Which version of .NET (64-bit or 32-bit) will be downloaded if some of the assemblies referenced by the application are compiled with only a 32-bit (instead of AnyMachine) value? Will the application still run as 64-bit, or will it force-run as 32-bit if at least one of the referenced assemblies is compiled as only 32-bit? The application runs .NET 3.5.

+4
source share
2 answers

The bitness is determined by setting the Target Platform to EXE. The mechanism does not guarantee that an EXE that references a 32-bit assembly will be forced to run in 32-bit mode. The assembly simply does not load using the BadImageFormatException.

If your program has a dependency on such a DLL, you must force the Target platform in your EXE project from AnyCPU to x86.

+4
source

The application will force to run as 32-bit

+5
source

Source: https://habr.com/ru/post/1308556/


All Articles