From de35e39f41a8f669a898e2fb30dffba785b6a0f1 Mon Sep 17 00:00:00 2001
From: Kyaw Thant <48363984+kythant@users.noreply.github.com>
Date: Fri, 21 Feb 2025 10:41:52 -0800
Subject: [PATCH 1/3] Remove NuGetToolInstaller tasks (#5173)

---
 .../WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml          | 2 --
 .../WindowsAppSDK-BuildFoundation-Steps.yml                 | 2 --
 .../WindowsAppSDK-BuildVSIX-Steps.yml                       | 2 --
 .../WindowsAppSDK-StaticValidationTest-Stage.yml            | 1 -
 build/ProjectReunion-CI.yml                                 | 6 ------
 5 files changed, 13 deletions(-)

diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml
index d771126f9d..cd997c4bcd 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-AnyCPU-Steps.yml
@@ -10,8 +10,6 @@ parameters:
   default: true
 
 steps:
-- task: NuGetToolInstaller@1
-
 - task: NuGetAuthenticate@1
   inputs:
     nuGetServiceConnections: 'TelemetryInternal'
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml
index 7c4365755c..db2cbecc5b 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildFoundation-Steps.yml
@@ -10,8 +10,6 @@ parameters:
   default: true
 
 steps:
-- task: NuGetToolInstaller@1
-
 - task: NuGetAuthenticate@1
   inputs:
     nuGetServiceConnections: 'TelemetryInternal'
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml
index eac5544ec3..3d2e5d97f1 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml
@@ -88,8 +88,6 @@ steps:
       }
       Exit 1
 
-- task: NuGetToolInstaller@1
-
 - task: NuGetAuthenticate@1
 
 - task: VSBuild@1
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-StaticValidationTest-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-StaticValidationTest-Stage.yml
index 9e3ba0b0ef..76bebe7bb5 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-StaticValidationTest-Stage.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-StaticValidationTest-Stage.yml
@@ -15,7 +15,6 @@ stages:
       name: 'ProjectReunionESPool-2022' # This stage is purely for ES, hence this custom pool
     timeoutInMinutes: 120
     steps:
-    - task: NuGetToolInstaller@1
     - task: NuGetAuthenticate@1
 
     - task: powershell@2
diff --git a/build/ProjectReunion-CI.yml b/build/ProjectReunion-CI.yml
index 6f03efda5d..c3a60f9ebc 100644
--- a/build/ProjectReunion-CI.yml
+++ b/build/ProjectReunion-CI.yml
@@ -83,8 +83,6 @@ jobs:
   - checkout: self
     persistCredentials: true
 
-  - task: NuGetToolInstaller@1
-
   - template: AzurePipelinesTemplates\WindowsAppSDK-SetupBuildEnvironment-Steps.yml
     parameters:
       IsOneBranch: false
@@ -111,8 +109,6 @@ jobs:
   pool:
     vmImage: 'windows-2022'
   steps:
-  - task: NuGetToolInstaller@1
-
   - template: AzurePipelinesTemplates\WindowsAppSDK-SetupBuildEnvironment-Steps.yml
     parameters:
       IsOneBranch: false
@@ -147,8 +143,6 @@ jobs:
   variables:
     ob_artifactBaseName: "MrtBinaries_$(buildConfiguration)_$(buildPlatform)" # For BuildMRT to publish t
   steps:
-  - task: NuGetToolInstaller@1
-
   - template: AzurePipelinesTemplates\WindowsAppSDK-BuildMRT-Steps.yml
     parameters:
       IsOneBranch: false

From 811d6da6fb31aac6363ae1efdfa6eef09de1c0dc Mon Sep 17 00:00:00 2001
From: Kyaw Thant <48363984+kythant@users.noreply.github.com>
Date: Mon, 24 Feb 2025 12:36:11 -0800
Subject: [PATCH 2/3] Set R1 Network Flag on Windows Container Image (#5169)

---
 build/WindowsAppSDK-BuildDevCheck.yml       | 3 +++
 build/WindowsAppSDK-Foundation-Nightly.yml  | 5 ++++-
 build/WindowsAppSDK-Foundation-Official.yml | 5 ++++-
 build/WindowsAppSDK-Foundation-PR.yml       | 5 ++++-
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/build/WindowsAppSDK-BuildDevCheck.yml b/build/WindowsAppSDK-BuildDevCheck.yml
index 3fd19418ce..f734846361 100644
--- a/build/WindowsAppSDK-BuildDevCheck.yml
+++ b/build/WindowsAppSDK-BuildDevCheck.yml
@@ -21,6 +21,9 @@ extends:
   parameters:
     platform:
       name: 'windows_undocked' # windows undocked
+    featureFlags:
+      WindowsHostVersion:
+        Network: R1
 
     stages:
     - stage: PackageDevCheck
diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml
index e5ddf5ef84..c0e84fc662 100644
--- a/build/WindowsAppSDK-Foundation-Nightly.yml
+++ b/build/WindowsAppSDK-Foundation-Nightly.yml
@@ -54,7 +54,10 @@ extends:
   template: v2/Microsoft.NonOfficial.yml@templates # https://aka.ms/obpipelines/templates
   parameters:
     featureFlags:
-      EnableCDPxPAT: false
+      EnableCDPxPAT: false      
+      WindowsHostVersion:
+        Network: R1
+
     platform:
       name: 'windows_undocked' # windows undocked
 
diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml
index 498883f37a..03a639fbb6 100644
--- a/build/WindowsAppSDK-Foundation-Official.yml
+++ b/build/WindowsAppSDK-Foundation-Official.yml
@@ -54,7 +54,10 @@ extends:
   template: v2/Microsoft.Official.yml@templates # https://aka.ms/obpipelines/templates
   parameters:
     featureFlags:
-      EnableCDPxPAT: false
+      EnableCDPxPAT: false      
+      WindowsHostVersion:
+        Network: R1
+
     platform:
       name: 'windows_undocked' # windows undocked
 
diff --git a/build/WindowsAppSDK-Foundation-PR.yml b/build/WindowsAppSDK-Foundation-PR.yml
index df2efb4a56..02b35292ac 100644
--- a/build/WindowsAppSDK-Foundation-PR.yml
+++ b/build/WindowsAppSDK-Foundation-PR.yml
@@ -45,7 +45,10 @@ extends:
   template: v2/Microsoft.NonOfficial.yml@templates # https://aka.ms/obpipelines/templates
   parameters:
     featureFlags:
-      EnableCDPxPAT: false
+      EnableCDPxPAT: false      
+      WindowsHostVersion:
+        Network: R1
+
     platform:
       name: 'windows_undocked' # windows undocked
 

From 23dff43c7754ffd49f5f8844abb4ff320f74e89f Mon Sep 17 00:00:00 2001
From: Kyaw Thant <48363984+kythant@users.noreply.github.com>
Date: Wed, 26 Feb 2025 15:04:21 -0800
Subject: [PATCH 3/3] Remove NuGetWrapper.cmd Usage from dist.nuget.org (#5189)

---
 BuildAll.ps1                  | 16 ++--------------
 build/NuSpecs/build-nupkg.ps1 |  6 ++----
 tools/NugetWrapper.cmd        | 23 -----------------------
 3 files changed, 4 insertions(+), 41 deletions(-)
 delete mode 100644 tools/NugetWrapper.cmd

diff --git a/BuildAll.ps1 b/BuildAll.ps1
index a883e697b5..8e983d1ec0 100644
--- a/BuildAll.ps1
+++ b/BuildAll.ps1
@@ -56,18 +56,6 @@ if ($Clean)
     Exit
 }
 
-# Make sure nuget directory exists.
-if(-not (test-path ".nuget"))
-{
-    new-item -path ".nuget" -itemtype directory
-}
-
-# Make sure nuget is on the system
-if(-not (test-path ".nuget\nuget.exe"))
-{
-    Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile .nuget\nuget.exe
-}
-
 $configurationForMrtAndAnyCPU = "Release"
 $MRTSourcesDirectory = "dev\MRTCore"
 
@@ -90,7 +78,7 @@ function NugetRestore([string] $Label, [string] $Target)
     {
         $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
+    nuget restore $Target -configfile NuGet.config
     if ($lastexitcode -ne 0)
     {
         write-host "ERROR: nuget.exe restore $Label FAILED."
@@ -383,7 +371,7 @@ Try {
         Set-Content -Value $publicNuspec.OuterXml $nuspecPath
 
         # Make the foundation transport package.
-        & .\.nuget\nuget.exe pack $nuspecPath -BasePath $BasePath -OutputDirectory $OutputDirectory
+        nuget pack $nuspecPath -BasePath $BasePath -OutputDirectory $OutputDirectory
 
         if ($lastexitcode -ne 0)
         {
diff --git a/build/NuSpecs/build-nupkg.ps1 b/build/NuSpecs/build-nupkg.ps1
index 40ce8e695e..d26166344d 100644
--- a/build/NuSpecs/build-nupkg.ps1
+++ b/build/NuSpecs/build-nupkg.ps1
@@ -119,8 +119,7 @@ Copy-IntoNewDirectory -IfExists $BuildOutput\$BuildFlavor\arm64\Microsoft.Window
 # Build Windows App SDK package (with actual contents, i.e. not metapackage)
 #
 
-$nugetExe = "$scriptDirectory\..\..\tools\NugetWrapper.cmd"
-$NugetCmdLine = "$nugetExe pack WindowsAppSDK.nuspec $NugetArgs -version $version"
+$NugetCmdLine = "nuget pack WindowsAppSDK.nuspec $NugetArgs -version $version"
 Write-Host 'Building Windows SDK package'
 Write-Host $NugetCmdLine
 Invoke-Expression $NugetCmdLine
@@ -137,8 +136,7 @@ Write-Host
 
 ConfigureNugetCommandLine("Microsoft.WindowsAppSDK.MetaPackage")
 
-$nugetExe = "$scriptDirectory\..\..\tools\NugetWrapper.cmd"
-$NugetCmdLine = "$nugetExe pack WindowsAppSDKMetaPackage.nuspec $NugetArgs -version $version"
+$NugetCmdLine = "nuget pack WindowsAppSDKMetaPackage.nuspec $NugetArgs -version $version"
 Write-Host 'Building Windows App SDK Meta Package'
 Write-Host $NugetCmdLine
 Invoke-Expression $NugetCmdLine
diff --git a/tools/NugetWrapper.cmd b/tools/NugetWrapper.cmd
deleted file mode 100644
index ad501e825c..0000000000
--- a/tools/NugetWrapper.cmd
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo OFF
-setlocal
-
-if "%VisualStudioVersion%" == "" set VisualStudioVersion=15.0
-
-if defined NUGETEXETOOLPATH goto :AzurePipelines
-
-if not exist %TEMP%\nuget.4.9.2.exe (
-    echo Nuget.exe not found in the temp dir, downloading.
-    powershell -Command "& { Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/v4.9.2/nuget.exe -outfile $env:TEMP\nuget.4.9.2.exe }"
-)
-
-%TEMP%\nuget.4.9.2.exe %*
-
-exit /B %ERRORLEVEL%
-
-
-
-:AzurePipelines
-echo NUGETEXETOOLPATH = %NUGETEXETOOLPATH%
-
-%NUGETEXETOOLPATH% %*
-exit /B %ERRORLEVEL%