From d917abe96f0caa2db96d28322fd8b20624d254a6 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Mon, 22 Oct 2018 17:12:18 -0700 Subject: [PATCH] Ensure inputs exist for CreateAppHost task. This commit fixes design time builds where the intermediate assembly may not exist, causing the `CreateAppHost` task to fail. The change is to condition the `_CreateAppHost` target based on the existence of the two input files: the intermediate assembly and the native apphost. Fixes #2599. --- .../targets/Microsoft.NET.Sdk.targets | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets index 09fc3850daed..918932eb19b9 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets @@ -283,10 +283,10 @@ Copyright (c) .NET Foundation. All rights reserved. --> + Condition="'$(ComputeNETCoreBuildOutputFiles)' == 'true' and Exists('@(IntermediateAssembly)') and Exists('@(_NativeRestoredAppHostNETCore)')"> <_UseWindowsGraphicalUserInterface Condition="($(RuntimeIdentifier.StartsWith('win')) or $(DefaultAppHostRuntimeIdentifier.StartsWith('win'))) and '$(OutputType)'=='WinExe'">true @@ -294,8 +294,7 @@ Copyright (c) .NET Foundation. All rights reserved. AppHostDestinationPath="@(_NativeAppHostNETCore)" AppBinaryName="$(AssemblyName)$(TargetExt)" IntermediateAssembly="@(IntermediateAssembly->'%(FullPath)')" - WindowsGraphicalUserInterface="$(_UseWindowsGraphicalUserInterface)" - Condition="'@(_NativeRestoredAppHostNETCore)' != ''" /> + WindowsGraphicalUserInterface="$(_UseWindowsGraphicalUserInterface)" />