Add validation target for netstandard
authorViktor Hofer <viktor.hofer@microsoft.com>
Thu, 30 May 2019 03:02:40 +0000 (05:02 +0200)
committerViktor Hofer <viktor.hofer@microsoft.com>
Thu, 30 May 2019 14:18:51 +0000 (16:18 +0200)
Commit migrated from https://github.com/dotnet/corefx/commit/7c51e15fab50e8b3492d80dbc6b8a15db744dfa1

src/libraries/Directory.Build.targets

index 86930b5..77b9bae 100644 (file)
           Condition="'$(IsTestProject)' == 'true' and '$(IsTestSupportProject)' != 'true'"
           DependsOnTargets="BuildAndTest" />
 
+  <Target Name="ValidateTestProjectConfigurations"
+          BeforeTargets="CoreCompile"
+          Condition="'$(IsTestProject)' == 'true' and '$(IsTestSupportProject)' != 'true' and '$(TargetsNetStandard)' == 'true'">
+
+    <Error Text="Targeting .NET Standard in a test project isn't supported." />
+    
+  </Target>
+
   <PropertyGroup>
     <!--
     Hack workaround to skip the GenerateCompiledExpressionsTempFile target in