I have an .msbuild import that defines a property group containing preprocessor definitions, among other things:
<PropertyGroup>
<DefineConstants>$(DefineConstants);MY_CONSTANT_VALUE</DefineConstants>
</PropertyGroup>
This is <import>
ed into both csproj and vcxproj files. At build time, the C# preprocessor appears not to have visibility of the defined constants. However, an equivalent C++ preprocessor definition in the same file works correctly, and the constants are discovered:
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>$(PreProcessorDefinitions);MY_CONSTANT_VALUE</PreprocessorDefinitions>
</ClCompile>
<ItemDefinitionGroup>
Any ideas why this only works in C++?