3 回答
TA贡献1841条经验 获得超3个赞
<PropertyGroup Condition=" '$(Framework)' == 'NET20' "> <DefineConstants>NET20</DefineConstants> <OutputPath>bin\$(Configuration)\$(Framework)</OutputPath></PropertyGroup><PropertyGroup Condition=" '$(Framework)' == 'NET35' "> <DefineConstants>NET35</DefineConstants> <OutputPath>bin\$(Configuration)\$(Framework)</OutputPath></PropertyGroup>
<Framework Condition=" '$(Framework)' == '' ">NET35</Framework>
<Target Name="AfterBuild"> <MSBuild Condition=" '$(Framework)' != 'NET20'" Projects="$(MSBuildProjectFile)" Properties="Framework=NET20" RunEachTargetSeparately="true" /></Target>
<Compile Include="SomeNet20SpecificClass.cs" Condition=" '$(Framework)' == 'NET20' " />
<Reference Include="Some.Assembly" Condition="" '$(Framework)' == 'NET20' " > <HintPath>..\Lib\$(Framework)\Some.Assembly.dll</HintPath></Reference>
TA贡献2016条经验 获得超9个赞
<PropertyGroup> <DefineConstants Condition=" !$(DefineConstants.Contains(';NET')) ">$(DefineConstants);$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""))</DefineConstants> <DefineConstants Condition=" $(DefineConstants.Contains(';NET')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(";NET"))));$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""))</DefineConstants> </PropertyGroup>
#if NETxx
TA贡献1802条经验 获得超5个赞
<DefineConstants /><DefineDebug>true</DefineDebug><DefineTrace>true</DefineTrace><DebugSymbols>true</DebugSymbols>
<PropertyGroup> <!-- Adding a custom constant will auto-magically append a comma and space to the pre-built constants. --> <!-- Move the comma delimiter to the end of each constant and remove the trailing comma when we're done. --> <DefineConstants Condition=" !$(DefineConstants.Contains(', NET')) ">$(DefineConstants)$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", "")), </DefineConstants> <DefineConstants Condition=" $(DefineConstants.Contains(', NET')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(", NET"))))$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", "")), </DefineConstants> <DefineConstants Condition=" $(TargetFrameworkVersion.Replace('v', '')) >= 2.0 ">$(DefineConstants)NET_20_OR_GREATER, </DefineConstants> <DefineConstants Condition=" $(TargetFrameworkVersion.Replace('v', '')) >= 3.5 ">$(DefineConstants)NET_35_OR_GREATER</DefineConstants> <DefineConstants Condition=" $(DefineConstants.EndsWith(', ')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(", "))))</DefineConstants></PropertyGroup>
- 3 回答
- 0 关注
- 555 浏览
添加回答
举报