2010-05-11 49 views

回答

67
  • $(...)用於訪問Property值(上Property element更多信息)

    <PropertyGroup> 
        <Configuration>Debug</Configuration> 
    </PropertyGroup> 
    
    <Message Text="Configuration = $(Configuration)"/> 
    
  • @(...)用於訪問Item值(上Item element更多信息)

    <ItemGroup> 
        <Reference Include="System.Data"/> 
        <Reference Include="System.Web.*"/> 
    </ItemGroup> 
    
    <Message Text="References = @(Reference)"/> 
    
  • %(...)用於訪問Item Metadata價值(更多關於Item Metadata的信息)。它也被用來做batching

    <ItemGroup> 
        <Compile Include="Account\ChangePassword.aspx.cs"> 
        <DependentUpon>ChangePassword.aspx</DependentUpon> 
        <SubType>ASPXCodeBehind</SubType> 
        <Compile/> 
    </ItemGroup> 
    
    <Message Text="Element @(Compile) of subtype %(SubType) and depend of %(DependentUpon)"/> 
    
14

Dollar - $(MyProp):允許引用PropertyGroups內指定的值。

At Sign - @(CodeFile):允許您引用ItemGroups中指定的項目列表。

Percent - %(CodeFile.BatchNum):允許您使用元數據引用批量ItemGroup值。這有點複雜,所以絕對要查看文檔以獲取更多信息。

查看每個鏈接以獲取有關如何使用這些信息的更多詳細信息。祝你好運,希望這會有幫助!