From b29ddbc093bb1f4d851b335eca08fe563b03d5aa Mon Sep 17 00:00:00 2001
From: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Date: Thu, 3 Nov 2022 15:54:05 +0100
Subject: [PATCH 1/2] Fix for #14201

---
 tests/projects/SelfContained_Trimming_Test/NuGet.Config    | 4 ++--
 .../SelfContained_Trimming_Test.fsproj                     | 7 -------
 tests/projects/SelfContained_Trimming_Test/check.ps1       | 2 +-
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/tests/projects/SelfContained_Trimming_Test/NuGet.Config b/tests/projects/SelfContained_Trimming_Test/NuGet.Config
index e8af19a856b..ed5be2d5fc6 100644
--- a/tests/projects/SelfContained_Trimming_Test/NuGet.Config
+++ b/tests/projects/SelfContained_Trimming_Test/NuGet.Config
@@ -6,7 +6,7 @@
     <packageSources>
         <clear />
         <add key="localPackages" value="../../../artifacts/packages/Release/Release"/>
-        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
+        <add key="remote" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
     </packageSources>
     <disabledPackageSources>
         <clear />
@@ -18,7 +18,7 @@
         <packageSource key="localPackages">
             <package pattern="FSharp.Core" />
         </packageSource>
-        <packageSource key="nuget.org">
+        <packageSource key="remote">
             <package pattern="*" />
         </packageSource>
     </packageSourceMapping>
diff --git a/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj
index 6654cf18e18..72feceb7d81 100644
--- a/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj
+++ b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj
@@ -29,13 +29,6 @@
 
   <Import Project="$(MSBuildThisFileDirectory)../../../eng/Versions.props" />
 
-  <PropertyGroup>
-      <RestoreSources>
-        $(MSBuildThisFileDirectory)/../../../artifacts/packages/Release/Release;
-        https://api.nuget.org/v3/index.json;
-      </RestoreSources>
-  </PropertyGroup>
-
   <ItemGroup>
       <PackageReference Include="FSharp.Core" Version="$(FSCoreProductVersion).*"/>
   </ItemGroup>
diff --git a/tests/projects/SelfContained_Trimming_Test/check.ps1 b/tests/projects/SelfContained_Trimming_Test/check.ps1
index 3eb0dfd449e..f7220645511 100644
--- a/tests/projects/SelfContained_Trimming_Test/check.ps1
+++ b/tests/projects/SelfContained_Trimming_Test/check.ps1
@@ -19,5 +19,5 @@ $file = Get-Item .\bin\Release\net7.0\win-x64\publish\FSharp.Core.dll
 $file_len = $file.Length
 if (-not ($file_len -eq $expected_len))
 {
-    Write-Error "Test failed with unexpected FSharp.Core length:`nExpected:`n`t${expected_len} Bytes`nActual:`n`t${file_len} Bytes" -ErrorAction Stop
+    Write-Error "Test failed with unexpected FSharp.Core length:`nExpected:`n`t${expected_len} Bytes`nActual:`n`t${file_len} Bytes`nEiter codegen or trimming logic have changed. Please investigate and either update expected size or report an issue." -ErrorAction Stop
 }
\ No newline at end of file

From 867754f1a961a9886a8628784b5f22a62efa11b5 Mon Sep 17 00:00:00 2001
From: Vlad Zarytovskii <vzaritovsky@hotmail.com>
Date: Thu, 3 Nov 2022 16:06:45 +0100
Subject: [PATCH 2/2] Apply suggestions from code review

---
 tests/projects/SelfContained_Trimming_Test/check.ps1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/projects/SelfContained_Trimming_Test/check.ps1 b/tests/projects/SelfContained_Trimming_Test/check.ps1
index f7220645511..fbc122b4158 100644
--- a/tests/projects/SelfContained_Trimming_Test/check.ps1
+++ b/tests/projects/SelfContained_Trimming_Test/check.ps1
@@ -19,5 +19,5 @@ $file = Get-Item .\bin\Release\net7.0\win-x64\publish\FSharp.Core.dll
 $file_len = $file.Length
 if (-not ($file_len -eq $expected_len))
 {
-    Write-Error "Test failed with unexpected FSharp.Core length:`nExpected:`n`t${expected_len} Bytes`nActual:`n`t${file_len} Bytes`nEiter codegen or trimming logic have changed. Please investigate and either update expected size or report an issue." -ErrorAction Stop
+    Write-Error "Test failed with unexpected FSharp.Core length:`nExpected:`n`t${expected_len} Bytes`nActual:`n`t${file_len} Bytes`nEither codegen or trimming logic have changed. Please investigate and update expected dll size or report an issue." -ErrorAction Stop
 }
\ No newline at end of file
