-<Project DefaultTargets="Build" InitialTargets="_ValidateEssentialProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" InitialTargets="_CheckForInvalidConfigurationAndPlatform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
<ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
<_OriginalPlatform>$(Platform)</_OriginalPlatform>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
+ </PropertyGroup>
+ <!-- in MSBuild, these properties are set in a separate file that is only imported for .NETFramework -->
+ <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<AddAdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == ''">true</AddAdditionalExplicitAssemblyReferences>
<AdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == 'true' and '$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0'">System.Core;$(AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
</PropertyGroup>
<TargetingClr2Framework Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5')">true</TargetingClr2Framework>
</PropertyGroup>
- <Target Name="_ValidateEssentialProperties">
+ <Target Name="_CheckForInvalidConfigurationAndPlatform">
<Error Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' != 'true'"
Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/>
<FileWrites Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
</ItemGroup>
- <Target Name="GenerateTargetFrameworkMonikerAttribute"
+ <Target Name="_GenerateTargetFrameworkMonikerAttribute"
DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
- Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
- Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
+ Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)">
<WriteLinesToFile
File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
ContinueOnError="true"
Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"
/>
+ </Target>
+
+ <Target Name="GenerateTargetFrameworkMonikerAttribute"
+ DependsOnTargets="_GenerateTargetFrameworkMonikerAttribute"
+ Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
<ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
<Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>