From 3d7cec3c29349586f2928e5ec669be24ce70492e Mon Sep 17 00:00:00 2001
From: Scott Jones <sjones@microsoft.com>
Date: Fri, 13 Dec 2024 16:57:02 -0800
Subject: [PATCH] Cherry pick LKG/MsUCRT fixes (#4970)

* Include STL/CRT libs and headers with LKG to eliminate yvals_core.h static_assert build errors on mismatch (#4933)

* include STL/CRT libs/headers with LKG

* add platform

* opt into internal UCRT

* opt into undocked settings loaded

* publish binlogs on failure

* use lower case platform for LKG toolset

* treat Platform as local to allow override of x86 to win32 for LKG

* define GUID_NULL, publish binlog on binary build failure

* define GUID_NULL another way

* collect binlogs for nuget restores

* fix restore binlog name

* nuget restore with platform for LKG compat, renamed BuildBinaries to BuildFoundation for clarity

* setting platform to win32 has downstream effects - surgically wrapping LKG imports instead

* import MsUCRT x86 targets explicitly

* removed unnecessary LKG targets overrides

* Find custom.props in parent dir (#4946)

* Update LkgToolset.props

Fix build break - custom.props in parent directory

* Update LkgToolset.props
---
 BuildAll.ps1                                  | 106 ++++++------------
 Directory.Build.props                         |   4 +-
 LkgToolset.props                              |  23 ++++
 .../WindowsAppSDK-Build-Stage.yml             |   8 +-
 ...wsAppSDK-BuildFoundation-AnyCPU-Steps.yml} |   2 +-
 ...> WindowsAppSDK-BuildFoundation-Steps.yml} |  10 +-
 .../WindowsAppSDK-BuildInstaller-Steps.yml    |   4 +
 .../WindowsAppSDK-BuildMRT-Steps.yml          |   4 +
 installer/dev/main.cpp                        |   5 +
 9 files changed, 86 insertions(+), 80 deletions(-)
 create mode 100644 LkgToolset.props
 rename build/AzurePipelinesTemplates/{WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml => WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml} (99%)
 rename build/AzurePipelinesTemplates/{WindowsAppSDK-BuildBinaries-Steps.yml => WindowsAppSDK-BuildFoundation-Steps.yml} (95%)

diff --git a/BuildAll.ps1 b/BuildAll.ps1
index 5e621d95d2..7c4fc0751b 100644
--- a/BuildAll.ps1
+++ b/BuildAll.ps1
@@ -77,7 +77,6 @@ write-host "VCToolsInstallDir: $VCToolsInstallDir"
 $msBuildPath = "$VCToolsInstallDir\MSBuild\Current\Bin\msbuild.exe"
 write-host "msBuildPath: $msBuildPath"
 
-
 # Generate overrides
 # Make sure override directory exists.
 if(-not (test-path "$buildOverridePath"))
@@ -85,6 +84,20 @@ if(-not (test-path "$buildOverridePath"))
     new-item -path "$buildOverridePath" -itemtype "directory"
 }
 
+function NugetRestore([string] $Label, [string] $Target)
+{
+    if ($AzureBuildStep -ne "all")
+    {
+        $env:NUGET_RESTORE_MSBUILD_ARGS = "/binaryLogger:BuildOutput\binlogs\$Label.restore.$Platform.$Configuration.binlog /p:Platform=$Platform /p:Configuration=$Configuration"
+    }
+    & .\.nuget\nuget.exe restore $Target -configfile NuGet.config
+    if ($lastexitcode -ne 0)
+    {
+        write-host "ERROR: nuget.exe restore $Label FAILED."
+        exit 1
+    }
+}
+
 Try {
     $WindowsAppSDKBuildPipeline = 0
 
@@ -109,34 +122,23 @@ Try {
         # If $AzureBuildStep is not "all", that means we are in the pipeline
         $WindowsAppSDKBuildPipeline = 1
     }
-    # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildBinaries or BuildMRT, except
+    # PreFastSetup is specifically for use when preparing for PREFast scans. It triggers the same actions below as BuildFoundation or BuildMRT, except
     # PreFastSetup stops short of calling msBuild.exe to build the target, which the Guardian:PREFast task does _not_ support, so the caller of this
     # script needs to resort to calling the MSBuild/VSBuild task later to build the target, which the Guardian:PREFast task does support. Structuring
     # the code this way allows minimally diveraging the flow while supporting building the target both via this script and the VSBuild/MSBuild task.
-    if (($AzureBuildStep -eq "all") -Or (($AzureBuildStep -eq "BuildBinaries") -Or ($AzureBuildStep -eq "BuildMRT") -Or ($AzureBuildStep -eq "PreFastSetup")))
+    if (($AzureBuildStep -eq "all") -Or (($AzureBuildStep -eq "BuildFoundation") -Or ($AzureBuildStep -eq "BuildMRT") -Or ($AzureBuildStep -eq "PreFastSetup")))
     {
-        & .\.nuget\nuget.exe restore WindowsAppRuntime.sln -configfile NuGet.config
-
-        if ($lastexitcode -ne 0)
-        {
-            write-host "ERROR: restore WindowsAppRuntime.sln FAILED."
-            exit 1
-        }
-
-        & .\.nuget\nuget.exe restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" -configfile NuGet.config
-
-        if ($lastexitcode -ne 0)
-        {
-            write-host "ERROR: restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
-            exit 1
-        }
+        NugetRestore "WindowsAppRuntime" "WindowsAppRuntime.sln"
+        NugetRestore "Microsoft.WindowsAppRuntime.Bootstrap.Net" "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj"
 
         $srcPath = Get-Childitem -Path 'dev\WindowsAppRuntime_Insights\packages' -File 'MicrosoftTelemetry.h' -Recurse
 
-        if (($srcPath -ne $null)){
+        if (($srcPath -ne $null))
+        {
             $destinationPaths = Get-Childitem -Path 'packages' -File 'Traceloggingconfig.h' -Recurse
 
-            if (($destinationPaths -ne $null)) {
+            if (($destinationPaths -ne $null)) 
+            {
                 foreach ($destPath in $destinationPaths) {
                 Write-Host 'SourcePath:' $srcPath.FullName
                 Write-Host 'DestinationPath:' $destPath.FullName
@@ -152,7 +154,7 @@ Try {
         }
     }
     # PreFastSetup intentionally skips the call to MSBuild.exe below.
-    if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildBinaries"))
+    if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildFoundation"))
     {
         foreach($configurationToRun in $configuration.Split(","))
         {
@@ -162,7 +164,7 @@ Try {
                 & $msBuildPath /restore `
                                 WindowsAppRuntime.sln `
                                 /p:Configuration=$configurationToRun,Platform=$platformToRun `
-                                /binaryLogger:"BuildOutput/WindowsAppRuntime.$platformToRun.$configurationToRun.binlog" `
+                                /binaryLogger:"BuildOutput/binlogs/WindowsAppRuntime.$platformToRun.$configurationToRun.binlog" `
                                 $WindowsAppSDKVersionProperty `
                                 /p:PGOBuildMode=$PGOBuildMode `
                                 /p:WindowsAppSDKCleanIntermediateFiles=true `
@@ -170,7 +172,7 @@ Try {
                                 /p:WindowsAppSDKBuildPipeline=$WindowsAppSDKBuildPipeline
                 if ($lastexitcode -ne 0)
                 {
-                    write-host "ERROR: msbuild.exe /restore WindowsAppRuntime.sln FAILED."
+                    write-host "ERROR: msbuild.exe WindowsAppRuntime.sln FAILED."
                     exit 1
                 }
             }
@@ -183,45 +185,11 @@ Try {
         #------------------
 
         #Restore packages from mrt.
-        & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\MrtCore.sln" -ConfigFile NuGet.config
-
-        if ($lastexitcode -ne 0)
-        {
-            write-host "ERROR: restore MrtCore.sln FAILED."
-            exit 1
-        }
-
-        & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config" -ConfigFile NuGet.config
-
-        if ($lastexitcode -ne 0)
-        {
-            write-host "ERROR: restore Microsoft.Windows.ApplicationModel.Resources\src\packages.config FAILED."
-            exit 1
-        }
-
-        & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmex\packages.config" -ConfigFile NuGet.config
-
-        if ($lastexitcode -ne 0)
-        {
-            write-host "ERROR: restore mrm\mrmex\packages.config FAILED."
-            exit 1
-        }
-
-        & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\mrmmin\packages.config" -ConfigFile NuGet.config
-
-        if ($lastexitcode -ne 0)
-        {
-            write-host "ERROR: restore mrmmin\packages.config FAILED."
-            exit 1
-        }
-
-        & .\.nuget\nuget.exe restore "$MRTSourcesDirectory\mrt\mrm\unittests\packages.config" -ConfigFile NuGet.config
-
-        if ($lastexitcode -ne 0)
-        {
-            write-host "ERROR: restore unittests\packages.config FAILED."
-            exit 1
-        }
+        NugetRestore "MrtCore" "$MRTSourcesDirectory\mrt\MrtCore.sln"
+        NugetRestore "Microsoft.Windows.ApplicationModel.Resources" "$MRTSourcesDirectory\mrt\Microsoft.Windows.ApplicationModel.Resources\src\packages.config"
+        NugetRestore "mrmex" "$MRTSourcesDirectory\mrt\mrm\mrmex\packages.config"
+        NugetRestore "mrmmin" "$MRTSourcesDirectory\mrt\mrm\mrmmin\packages.config"
+        NugetRestore "unittests" "$MRTSourcesDirectory\mrt\mrm\unittests\packages.config"
 
         # Init mrtcore
         foreach($platformToRun in $platform.Split(","))
@@ -246,11 +214,11 @@ Try {
                     & $msBuildPath /restore "$MRTSourcesDirectory\mrt\MrtCore.sln" `
                                     /p:Configuration=$configurationToRun,Platform=$platformToRun `
                                     /p:PGOBuildMode=$PGOBuildMode `
-                                    /binaryLogger:"BuildOutput/mrtcore.$platformToRun.$configurationToRun.binlog"
+                                    /binaryLogger:"BuildOutput/binlogs/MrtCore.$platformToRun.$configurationToRun.binlog"
 
                     if ($lastexitcode -ne 0)
                     {
-                        write-host "ERROR: Building '$MRTSourcesDirectory\mrt\MrtCore.sln' FAILED."
+                        write-host "ERROR: msbuild.exe '$MRTSourcesDirectory\mrt\MrtCore.sln' FAILED."
                         exit 1
                     }
                 }
@@ -262,11 +230,11 @@ Try {
         #------------------
         #    Build windowsAppRuntime.sln (anyCPU) and move output to staging.
         #------------------
-        # build AnyCPU
+        # build and restore AnyCPU
         & $msBuildPath /restore "dev\Bootstrap\CS\Microsoft.WindowsAppRuntime.Bootstrap.Net\Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj" /p:Configuration=$configurationForMrtAndAnyCPU,Platform=AnyCPU
         if ($lastexitcode -ne 0)
         {
-            write-host "ERROR: msbuild restore Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
+            write-host "ERROR: msbuild.exe Microsoft.WindowsAppRuntime.Bootstrap.Net.csproj FAILED."
             exit 1
         }
     }
@@ -417,12 +385,6 @@ Try {
             exit 1
         }
     }
-    # if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildMock"))
-    # {
-    #     $transportPackagepath = (Join-Path $OutputDirectory "Microsoft.WindowsAppSDK.Foundation.TransportPackage.$PackageVersion.nupkg")
-    #     . eng\common\Scripts\buildMockWinAppSdkPackage.ps1 -TransportPackageName "Foundation" -TransportPackagePath $transportPackagepath -RepoRoot $env:Build_SourcesDirectory -Output $OutputDirectory -Platform $Platform -Configuration $Configuration -TransportPackageVersion $PackageVersion -CleanOutput
-    # }
-
     $files = Get-ChildItem $OutputDirectory -File -Filter "*.nupkg"
     foreach ($file in $files)
     {
diff --git a/Directory.Build.props b/Directory.Build.props
index 0ce68daa26..9fb22e5b93 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,9 +1,10 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information. -->
 <!-- This is a special MSBuild file that is parsed before everything else when MSBuild detects it in our directory structure.
      Adding Sdk="Microsoft.NET.Sdk" to a project causes NuGet files to be generated very early on, so we need these defines to be here
      to ensure that all of our build output files end up in the same location. -->
 <Project InitialTargets="DirectoryBuildPropsInfo" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="LkgToolset.props" />
   <Import Project="eng\Version.Dependencies.props" />
   <!-- Due to import ordering inconsistencies between different project types, we import this file from multiple places. -->
   <Import Project="$(MSBuildThisFileDirectory)build\EnsureOutputLayout.props" Condition="$(EnsureOutputLayoutPropsIncluded) == ''" />
@@ -23,6 +24,7 @@
     <AssemblyOriginatorKeyFile>$(RepoRoot)\WasdkStrongNameSign.snk</AssemblyOriginatorKeyFile>
     <WindowsSdkPackageVersion>10.0.17763.$(CsWinRTDependencyWindowsSdkVersionSuffixPackageVersion)</WindowsSdkPackageVersion>
   </PropertyGroup>
+
   <PropertyGroup>
     <PreferredToolArchitecture>x64</PreferredToolArchitecture>
   </PropertyGroup>
diff --git a/LkgToolset.props b/LkgToolset.props
new file mode 100644
index 0000000000..c0df8fbb20
--- /dev/null
+++ b/LkgToolset.props
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
+<Project ToolsVersion="14.0" TreatAsLocalProperty="Platform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <!-- Enable synchronized LKG and internal MsUCRT consumption  -->
+  <PropertyGroup>
+    <UseInternalMSUniCrtPackage>true</UseInternalMSUniCrtPackage>
+    <UndockedSettingsLoaded>true</UndockedSettingsLoaded>
+  </PropertyGroup>
+
+  <!-- The LKG toolset only supports Platform=win32.  To work around, we TreatAsLocalProperty=Platform above to
+    enable overriding the global (command-line) Platform, explicitly import LKG's custom.props, and restore Platform. -->
+  <PropertyGroup Condition="'$(Platform)'=='x86'">
+    <WorkaroundLkgWin32>true</WorkaroundLkgWin32>
+    <Platform>Win32</Platform>
+    <CustomProps>$([MSBuild]::GetPathOfFileAbove('custom.props', '$(MSBuildThisFileDirectory)'))</CustomProps>
+  </PropertyGroup>
+  <Import Project="$(CustomProps)" Condition="Exists('$(CustomProps)') and '$(WorkaroundLkgWin32)'=='true'" />
+  <PropertyGroup Condition="'$(WorkaroundLkgWin32)'=='true'">
+    <Platform>x86</Platform>
+  </PropertyGroup>
+
+</Project>
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml
index 40f447015a..02d581f879 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-Build-Stage.yml
@@ -26,7 +26,7 @@ stages:
         targetType: filePath
         filePath: tools\VerifyCopyrightHeaders.ps1
 
-  - job: BuildBinaries
+  - job: BuildFoundation
     pool:
       ${{ if parameters.IsOneBranch }}:
         type: windows
@@ -63,13 +63,13 @@ stages:
       ob_sdl_apiscan_softwareFolder: '$(build.SourcesDirectory)\APIScanTarget'
       ob_sdl_apiscan_symbolsFolder: '$(build.SourcesDirectory)\APIScanTarget;SRV*https://symweb.azurefd.net'
     steps:
-    - template: WindowsAppSDK-BuildBinaries-Steps.yml@self
+    - template: WindowsAppSDK-BuildFoundation-Steps.yml@self
       parameters:
         SignOutput: ${{ parameters.SignOutput }}
         IsOneBranch: ${{ parameters.IsOneBranch }}
         runStaticAnalysis : ${{ parameters.runStaticAnalysis }}
 
-  - job: BuildBinaries_release_anycpu
+  - job: BuildFoundation_release_anycpu
     # For now, this job just builds Microsoft.WindowsAppRuntime.Bootstrap.Net.dll in AnyCPU
     # Can be expanded to add any other binary as needed
     pool:
@@ -90,7 +90,7 @@ stages:
       ob_sdl_apiscan_softwareFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU'
       ob_sdl_apiscan_symbolsFolder: '$(build.SourcesDirectory)\BuildOutput\Release\AnyCPU;SRV*https://symweb.azurefd.net'
     steps:
-    - template: WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml@self
+    - template: WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml@self
       parameters:
         SignOutput: ${{ parameters.SignOutput }}
         IsOneBranch: ${{ parameters.IsOneBranch }}
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml
similarity index 99%
rename from build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml
rename to build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml
index 25886ec5b3..174676c0d3 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-AnyCPU-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml
@@ -27,7 +27,7 @@ steps:
     IsOneBranch: ${{ parameters.IsOneBranch }}
 
 - task: PowerShell@2
-  name: BuildBinaries
+  name: BuildFoundation
   inputs:
     filePath: 'BuildAll.ps1'
     arguments: -AzureBuildStep "BuildAnyCPU"
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml
similarity index 95%
rename from build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-Steps.yml
rename to build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml
index 50e25de929..c587c36a80 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildBinaries-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml
@@ -63,12 +63,15 @@ steps:
     compilerPackageName: $(compilerOverridePackageName)
     compilerPackageVersion: $(compilerOverridePackageVersion)
     slnDirectory: $(Build.SourcesDirectory)
+    includeUCRT: true
+    ucrtFeedPat: $(System.AccessToken)
+    platform: $(buildPlatform)
 
 - task: PowerShell@2
-  name: BuildBinaries
+  name: BuildFoundation
   inputs:
     filePath: 'BuildAll.ps1'
-    arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildBinaries"
+    arguments: -Platform "$(buildPlatform)" -Configuration "$(buildConfiguration)" -AzureBuildStep "BuildFoundation"
 
 - ${{ if eq(parameters.runStaticAnalysis, 'True') }}:
   - task: SDLNativeRules@3
@@ -130,18 +133,21 @@ steps:
 # so the CopyFiles below are to move all the vPack files to the right locations
 - task: CopyFiles@2
   displayName: MoveToOutputDirectory
+  condition: always()
   inputs:
     SourceFolder: '$(build.SourcesDirectory)\BuildOutput'
     TargetFolder: '$(ob_outputDirectory)'
 
 - task: CopyFiles@2
   displayName: MoveToOutputDirectory
+  condition: always()
   inputs:
     SourceFolder: '$(build.SourcesDirectory)\packages'
     TargetFolder: '$(ob_outputDirectory)\packages'
 
 - ${{ if not( parameters.IsOneBranch ) }}:
   - task: PublishBuildArtifacts@1
+    condition: always()
     inputs:
       PathtoPublish: '$(ob_outputDirectory)'
       artifactName: '$(ob_artifactBaseName)'
\ No newline at end of file
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml
index e2e488190d..941f3fdbf9 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml
@@ -202,6 +202,9 @@ steps:
     compilerPackageName: $(compilerOverridePackageName)
     compilerPackageVersion: $(compilerOverridePackageVersion)
     slnDirectory: $(Build.SourcesDirectory)\$(foundationRepoPath)installer\dev
+    includeUCRT: true
+    ucrtFeedPat: $(System.AccessToken)
+    platform: $(buildPlatform)
 
 - task: VSBuild@1
   displayName: 'Build Windows App Runtime Install'
@@ -262,6 +265,7 @@ steps:
 
 - ${{ if ne(parameters.IsOneBranch, 'true') }}:
   - task: PublishBuildArtifacts@1
+    condition: always()
     inputs:
       PathtoPublish: '$(ob_outputDirectory)'
       artifactName: '$(ob_artifactBaseName)'
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml
index 3af5de7524..6299eb9410 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildMRT-Steps.yml
@@ -21,6 +21,9 @@ steps:
     compilerPackageName: $(compilerOverridePackageName)
     compilerPackageVersion: $(compilerOverridePackageVersion)
     slnDirectory: $(Build.SourcesDirectory)\dev\MRTCore\mrt
+    includeUCRT: true
+    ucrtFeedPat: $(System.AccessToken)
+    platform: $(buildPlatform)
 
 - task: PowerShell@2
   name: BuildBinaries
@@ -88,6 +91,7 @@ steps:
 
 - ${{ if not( parameters.IsOneBranch ) }}:
   - task: PublishBuildArtifacts@1
+    condition: always()
     inputs:
       PathtoPublish: '$(ob_outputDirectory)'
       artifactName: '$(ob_artifactBaseName)'
diff --git a/installer/dev/main.cpp b/installer/dev/main.cpp
index 8fe2f4b73f..9e2f79dcba 100644
--- a/installer/dev/main.cpp
+++ b/installer/dev/main.cpp
@@ -6,6 +6,11 @@
 #include "install.h"
 #include "resource.h"
 
+#ifndef GUID_NULL
+struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) GUID_NULL;
+#define GUID_NULL __uuidof(struct GUID_NULL)
+#endif
+
 using namespace winrt;
 
 using namespace WindowsAppRuntimeInstaller::Console;