Visual Studio project settings
Some basic Visual Studio project settings may be different from the defaults created by the Visual Studio Project Wizard. Ensure that you set up your project’s build settings to produce apps and DLLs that are compatible with Windows PE, as follows:
-
You must develop Windows PE apps with native C or C++ code that does not use MFC or ATL. Therefore, if you use the Visual Studio Project Wizard, choose a Win32 project and make sure that neither MFC nor ATL are checked.
-
Set your project options to link to the static C/C++ runtime libraries, not the .dll version of Msvcrt.dll.
-
Open your project properties and set Configuration Properties \ C/C++ RunTime Library to Multi-threaded or Multi-threaded debug, not one of the .dll versions. If you do not perform this step, your app might not run on Windows PE.
-
If you plan to host your app on the 64-bit version of Windows PE, set the project build options to compile all binaries with the x64 compiler in Visual Studio.
-
If you plan to host your app on the 32-bit version of Windows PE, set the project options to compile with the x86 compiler.
-
Ensure that your project does not have the /clr: compiler option set. This option produces managed C++ code, which will not run on Windows PE.
Warning Your app can use customized .dll files that you write or license from a third party. Add these .dll files to your app for Windows PE. However, do not use Msvcrt.dll and do not include additional Windows .dll files that are not part of Windows PE.