msbuildvcxproj

MSBuild Shorten Configuration Managment In vcxproj-Files


In the *.vcxproj files of this project there is a lot of code in like this

<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  [do some stuff]
</ImportGroup>

for all configurations, 'Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64'. But I will have the same configuration for all combinations, therefore I do not want to write it 4 times making my project file 3 times longer and less readable .

Is there a shortcut like Condition="'$(Configuration)|$(Platform)'=='Any Configuration|Any Architecture'?


Solution

  • The standard way of doing this would be using 'property sheets'; more concrete: one property sheet with the common options which gets imported by all platform/configuration combinations. Some reasons to choose this approach: