如何为Silverlight项目编写MSBuild不同?

时间:2011-08-17 21:30:59

标签: silverlight msbuild

我有导入:

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.tar ets" />

以及一堆特定于Silverlight的PropertyGroup,例如:

  <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  <SchemaVersion>2.0</SchemaVersion>
  <NoStdLib>true</NoStdLib>
  <NoStdCfg>true</NoStdCfg>
  -----etc.

如何编写使用上述目标的目标?

修改

我也有这些参考资料:

<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="system" />
<Reference Include="System.Windows" />
</ItemGroup>

1 个答案:

答案 0 :(得分:0)

只需将所有属性传递给MSBuild任务:

<Target Name="....">
   <MSBuild Projects="$(ProjectsToBuild)" 
            Properties="TargetFrameworkVersion=$(TargetFrameworkVersion); ... "/>
</Target>