Fixes building Host tests from VS (#55917)
authorVitek Karas <vitek.karas@microsoft.com>
Mon, 19 Jul 2021 16:54:03 +0000 (18:54 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Jul 2021 16:54:03 +0000 (09:54 -0700)
When building the Host tests projects from VS the CrossGen2 related properties are not set (probably because the build type is not set to Core - which doesn't matter for the tests).

Changed the includes to be conditional.

src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props

index 28ac4374be2ae2d871de4dc1af196f8b3bc2e970..3fe16b05bacc051460f6f81c0c9f678c3ffb088a 100644 (file)
     </ItemGroup>
   </Target>
 
-  <Import Project="$(Crossgen2SdkOverridePropsPath)" />
+  <Import Project="$(Crossgen2SdkOverridePropsPath)" Condition="'$(Crossgen2SdkOverridePropsPath)' != ''" />
   <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
   <Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
-  <Import Project="$(Crossgen2SdkOverrideTargetsPath)" />
+  <Import Project="$(Crossgen2SdkOverrideTargetsPath)" Condition="'$(Crossgen2SdkOverrideTargetsPath)' != ''" />
   <PropertyGroup>
     <PublishReadyToRunComposite Condition="$(ForcePublishReadyToRunComposite) == 'true'">true</PublishReadyToRunComposite>
   </PropertyGroup>