سؤال

WinRT project, C++/CX. When my XAML files are compiled, the generated code files contain an

#include "pch.h"

line. I want my precompiler header to be called differently - stdafx.h, for legacy code reasons. Changing it in project properties affects C++ sources, but not the XAML compiler - it still emits the pch.h line. I could not find XAML compiler settings anywhere in the project properties.

How do I change the PCH name that XAML compiler assumes, please?

هل كانت مفيدة؟

المحلول

The name of the precompiled headers file is not configurable in the XAML compiler in Visual Studio 2012. It is assumed to be pch.h, which is the default name of the file in all of the project templates.

It might be possible to tweak the build targets files to disable use of precompiled headers for XAML-generated C++ source files; I'm not that familiar with the targets, so I cannot say for sure. Alternatively, you could disable usage of precompiled headers for your project, then enable usage per-file for all of the non-generated C++ source files in the project.

If this feature is important to you, please consider opening an issue on Microsoft Connect.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top