我保持相當多的有20+的配置,仍然有些配置添加不時項目。將這種改變傳播到所有項目是我們現在用VCBuild所做的。我開始嘗試的MSBuild並似乎有一些邏輯來提取這些成單獨的屬性表,允許一個在一個地方做的改變。我該如何做到這一點?是否可以使用MSBuild將配置定義移動到屬性表中?
注意,我當我試圖做到這一點,Visual Studio中抱怨說,有項目中沒有的配置。下面是我試圖實現它的一個例子。提前致謝。
configurations.props:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug_Unicode|Win32">
<Configuration>Debug_Unicode</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
...
</ItemGroup>
凸出:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Label="Globals">
<ProjectName>projname</ProjectName>
<ProjectGuid>{XXX...XXX}</ProjectGuid>
<RootNamespace>proj</RootNamespace> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="configurations.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="other.props" /> </ImportGroup>
...
感謝您的信息,所以我會留在現在生成項目文件:( – Yakeen 2011-03-07 15:24:44
upvote連接錯誤報告在這裏https://connect.microsoft.com/VisualStudio/feedback/details/514008/vcxproj-doesnt-檢查-進口找到的項目的配置-β-2 – 2011-03-07 20:58:09
四處找不到網頁 – Yakeen 2011-03-08 10:40:19