dependabot-nuget 0.302.0 → 0.303.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/Directory.Packages.props +5 -5
  3. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/DependencyDiscoveryTargetingPacks.props +10 -0
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +96 -97
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +2 -0
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +3 -0
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/NuGetUpdater.Core.csproj +1 -0
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +8 -0
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectManager.cs +7 -4
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/LockFileUpdater.cs +2 -0
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +257 -37
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +12 -3
  13. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdateOperationBase.cs +209 -0
  14. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdateOperationResult.cs +3 -0
  15. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +79 -24
  16. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +11 -11
  17. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +19 -5
  18. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +24 -6
  19. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/PackageReferenceUpdaterTests.cs +177 -0
  20. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateOperationBaseTests.cs +130 -0
  21. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +5 -0
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Mixed.cs +71 -5
  23. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackageReference.cs +87 -3
  24. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +23 -0
  25. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +145 -147
  26. metadata +11 -7
@@ -1965,6 +1965,9 @@ public partial class UpdateWorkerTests
1965
1965
  <ItemGroup>
1966
1966
  <Compile Include="Properties\AssemblyInfo.cs" />
1967
1967
  </ItemGroup>
1968
+ <ItemGroup>
1969
+ <ProjectReference Include="other-project\other-project.csproj" />
1970
+ </ItemGroup>
1968
1971
  <PropertyGroup>
1969
1972
  <!-- some project files set this property which makes the Microsoft.WebApplication.targets import a few lines down always fail -->
1970
1973
  <VSToolsPath Condition="'$(VSToolsPath)' == ''">C:\some\path\that\does\not\exist</VSToolsPath>
@@ -1985,6 +1988,20 @@ public partial class UpdateWorkerTests
1985
1988
  <package id="Some.Package" version="7.0.1" targetFramework="net45" />
1986
1989
  </packages>
1987
1990
  """,
1991
+ additionalFiles:
1992
+ [
1993
+ ("other-project/other-project.csproj", """
1994
+ <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1995
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1996
+ <PropertyGroup>
1997
+ <OutputType>Library</OutputType>
1998
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1999
+ </PropertyGroup>
2000
+ <Import Project="$(VSToolsPath)\SomeSubPath\WebApplications\Microsoft.WebApplication.targets" />
2001
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
2002
+ </Project>
2003
+ """)
2004
+ ],
1988
2005
  expectedProjectContents: """
1989
2006
  <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1990
2007
  <PropertyGroup>
@@ -2046,6 +2063,9 @@ public partial class UpdateWorkerTests
2046
2063
  <ItemGroup>
2047
2064
  <Compile Include="Properties\AssemblyInfo.cs" />
2048
2065
  </ItemGroup>
2066
+ <ItemGroup>
2067
+ <ProjectReference Include="other-project\other-project.csproj" />
2068
+ </ItemGroup>
2049
2069
  <PropertyGroup>
2050
2070
  <!-- some project files set this property which makes the Microsoft.WebApplication.targets import a few lines down always fail -->
2051
2071
  <VSToolsPath Condition="'$(VSToolsPath)' == ''">C:\some\path\that\does\not\exist</VSToolsPath>
@@ -2426,6 +2446,7 @@ public partial class UpdateWorkerTests
2426
2446
  expectedResult: new()
2427
2447
  {
2428
2448
  Error = new PrivateSourceAuthenticationFailure([$"{http.BaseUrl.TrimEnd('/')}/index.json"]),
2449
+ UpdateOperations = [],
2429
2450
  }
2430
2451
  );
2431
2452
  }
@@ -2556,6 +2577,7 @@ public partial class UpdateWorkerTests
2556
2577
  expectedResult: new()
2557
2578
  {
2558
2579
  ErrorRegex = "Response status code does not indicate success",
2580
+ UpdateOperations = [],
2559
2581
  }
2560
2582
  );
2561
2583
  }
@@ -2633,6 +2655,7 @@ public partial class UpdateWorkerTests
2633
2655
  expectedResult: new()
2634
2656
  {
2635
2657
  Error = new DependencyNotFound("Unrelated.Package.1.0.0"),
2658
+ UpdateOperations = [],
2636
2659
  }
2637
2660
  );
2638
2661
  }
@@ -171,7 +171,7 @@ public class MSBuildHelperTests : TestBase
171
171
  new("Package.C", "3.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
172
172
  new("Package.D", "4.0.0", DependencyType.Unknown, TargetFrameworks: ["netstandard2.0"], IsTransitive: true),
173
173
  ];
174
- Dependency[] actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(
174
+ var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(
175
175
  temp.DirectoryPath,
176
176
  temp.DirectoryPath,
177
177
  "netstandard2.0",
@@ -424,7 +424,7 @@ public class MSBuildHelperTests : TestBase
424
424
  new("Package.B", "2.0.0", DependencyType.Unknown, TargetFrameworks: ["net8.0"], IsTransitive: true),
425
425
  ];
426
426
 
427
- Dependency[] actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(
427
+ var actualDependencies = await MSBuildHelper.GetAllPackageDependenciesAsync(
428
428
  temp.DirectoryPath,
429
429
  temp.DirectoryPath,
430
430
  "net8.0",
@@ -475,7 +475,7 @@ public class MSBuildHelperTests : TestBase
475
475
  {
476
476
  new Dependency("Some.Package", "1.2.0", DependencyType.PackageReference),
477
477
  new Dependency("Some.Other.Package", "1.0.0", DependencyType.PackageReference),
478
- };
478
+ }.ToImmutableArray();
479
479
  var update = new[]
480
480
  {
481
481
  new Dependency("Some.Other.Package", "1.2.0", DependencyType.PackageReference),
@@ -489,11 +489,11 @@ public class MSBuildHelperTests : TestBase
489
489
  new TestLogger()
490
490
  );
491
491
  Assert.NotNull(resolvedDependencies);
492
- Assert.Equal(2, resolvedDependencies.Length);
493
- Assert.Equal("Some.Package", resolvedDependencies[0].Name);
494
- Assert.Equal("1.2.0", resolvedDependencies[0].Version);
495
- Assert.Equal("Some.Other.Package", resolvedDependencies[1].Name);
496
- Assert.Equal("1.2.0", resolvedDependencies[1].Version);
492
+ Assert.Equal(2, resolvedDependencies.Value.Length);
493
+ Assert.Equal("Some.Package", resolvedDependencies.Value[0].Name);
494
+ Assert.Equal("1.2.0", resolvedDependencies.Value[0].Version);
495
+ Assert.Equal("Some.Other.Package", resolvedDependencies.Value[1].Name);
496
+ Assert.Equal("1.2.0", resolvedDependencies.Value[1].Version);
497
497
  }
498
498
  finally
499
499
  {
@@ -663,11 +663,11 @@ public class MSBuildHelperTests : TestBase
663
663
  new Dependency("CS-Script.Core", "1.3.1", DependencyType.PackageReference),
664
664
  new Dependency("Microsoft.CodeAnalysis.Common", "3.4.0", DependencyType.PackageReference),
665
665
  new Dependency("Microsoft.CodeAnalysis.Scripting.Common", "3.4.0", DependencyType.PackageReference),
666
- };
666
+ }.ToImmutableArray();
667
667
  var update = new[]
668
668
  {
669
669
  new Dependency("CS-Script.Core", "2.0.0", DependencyType.PackageReference),
670
- };
670
+ }.ToImmutableArray();
671
671
 
672
672
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
673
673
  tempDirectory.DirectoryPath,
@@ -679,13 +679,13 @@ public class MSBuildHelperTests : TestBase
679
679
  new TestLogger()
680
680
  );
681
681
  Assert.NotNull(resolvedDependencies);
682
- Assert.Equal(3, resolvedDependencies.Length);
683
- Assert.Equal("CS-Script.Core", resolvedDependencies[0].Name);
684
- Assert.Equal("2.0.0", resolvedDependencies[0].Version);
685
- Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies[1].Name);
686
- Assert.Equal("3.6.0", resolvedDependencies[1].Version);
687
- Assert.Equal("Microsoft.CodeAnalysis.Scripting.Common", resolvedDependencies[2].Name);
688
- Assert.Equal("3.6.0", resolvedDependencies[2].Version);
682
+ Assert.Equal(3, resolvedDependencies.Value.Length);
683
+ Assert.Equal("CS-Script.Core", resolvedDependencies.Value[0].Name);
684
+ Assert.Equal("2.0.0", resolvedDependencies.Value[0].Version);
685
+ Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies.Value[1].Name);
686
+ Assert.Equal("3.6.0", resolvedDependencies.Value[1].Version);
687
+ Assert.Equal("Microsoft.CodeAnalysis.Scripting.Common", resolvedDependencies.Value[2].Name);
688
+ Assert.Equal("3.6.0", resolvedDependencies.Value[2].Version);
689
689
  }
690
690
 
691
691
  // Updating a dependency (Microsoft.Bcl.AsyncInterfaces) of the root package (Azure.Core) will require the root package to also update, but since the dependency is not in the existing list, we do not include it
@@ -710,11 +710,11 @@ public class MSBuildHelperTests : TestBase
710
710
  var dependencies = new[]
711
711
  {
712
712
  new Dependency("Azure.Core", "1.21.0", DependencyType.PackageReference)
713
- };
713
+ }.ToImmutableArray();
714
714
  var update = new[]
715
715
  {
716
716
  new Dependency("Microsoft.Bcl.AsyncInterfaces", "1.1.1", DependencyType.Unknown)
717
- };
717
+ }.ToImmutableArray();
718
718
 
719
719
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
720
720
  tempDirectory.DirectoryPath,
@@ -726,9 +726,9 @@ public class MSBuildHelperTests : TestBase
726
726
  new TestLogger()
727
727
  );
728
728
  Assert.NotNull(resolvedDependencies);
729
- Assert.Single(resolvedDependencies);
730
- Assert.Equal("Azure.Core", resolvedDependencies[0].Name);
731
- Assert.Equal("1.22.0", resolvedDependencies[0].Version);
729
+ Assert.Single(resolvedDependencies.Value);
730
+ Assert.Equal("Azure.Core", resolvedDependencies.Value[0].Name);
731
+ Assert.Equal("1.22.0", resolvedDependencies.Value[0].Version);
732
732
  }
733
733
 
734
734
  // Adding a reference
@@ -755,11 +755,11 @@ public class MSBuildHelperTests : TestBase
755
755
  var dependencies = new[]
756
756
  {
757
757
  new Dependency("Newtonsoft.Json.Bson", "1.0.2", DependencyType.PackageReference)
758
- };
758
+ }.ToImmutableArray();
759
759
  var update = new[]
760
760
  {
761
761
  new Dependency("Newtonsoft.Json", "13.0.1", DependencyType.Unknown)
762
- };
762
+ }.ToImmutableArray();
763
763
 
764
764
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
765
765
  tempDirectory.DirectoryPath,
@@ -771,11 +771,11 @@ public class MSBuildHelperTests : TestBase
771
771
  new TestLogger()
772
772
  );
773
773
  Assert.NotNull(resolvedDependencies);
774
- Assert.Equal(2, resolvedDependencies.Length);
775
- Assert.Equal("Newtonsoft.Json.Bson", resolvedDependencies[0].Name);
776
- Assert.Equal("1.0.2", resolvedDependencies[0].Version);
777
- Assert.Equal("Newtonsoft.Json", resolvedDependencies[1].Name);
778
- Assert.Equal("13.0.1", resolvedDependencies[1].Version);
774
+ Assert.Equal(2, resolvedDependencies.Value.Length);
775
+ Assert.Equal("Newtonsoft.Json.Bson", resolvedDependencies.Value[0].Name);
776
+ Assert.Equal("1.0.2", resolvedDependencies.Value[0].Version);
777
+ Assert.Equal("Newtonsoft.Json", resolvedDependencies.Value[1].Name);
778
+ Assert.Equal("13.0.1", resolvedDependencies.Value[1].Version);
779
779
  }
780
780
 
781
781
  // Updating unreferenced dependency
@@ -807,11 +807,11 @@ public class MSBuildHelperTests : TestBase
807
807
  new Dependency("Microsoft.CodeAnalysis.Compilers", "4.9.2", DependencyType.PackageReference),
808
808
  new Dependency("Microsoft.CodeAnalysis.CSharp", "4.9.2", DependencyType.PackageReference),
809
809
  new Dependency("Microsoft.CodeAnalysis.VisualBasic", "4.9.2", DependencyType.PackageReference)
810
- };
810
+ }.ToImmutableArray();
811
811
  var update = new[]
812
812
  {
813
813
  new Dependency("Microsoft.CodeAnalysis.Common", "4.10.0", DependencyType.PackageReference)
814
- };
814
+ }.ToImmutableArray();
815
815
 
816
816
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
817
817
  tempDirectory.DirectoryPath,
@@ -823,13 +823,13 @@ public class MSBuildHelperTests : TestBase
823
823
  new TestLogger()
824
824
  );
825
825
  Assert.NotNull(resolvedDependencies);
826
- Assert.Equal(3, resolvedDependencies.Length);
827
- Assert.Equal("Microsoft.CodeAnalysis.Compilers", resolvedDependencies[0].Name);
828
- Assert.Equal("4.10.0", resolvedDependencies[0].Version);
829
- Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies[1].Name);
830
- Assert.Equal("4.10.0", resolvedDependencies[1].Version);
831
- Assert.Equal("Microsoft.CodeAnalysis.VisualBasic", resolvedDependencies[2].Name);
832
- Assert.Equal("4.10.0", resolvedDependencies[2].Version);
826
+ Assert.Equal(3, resolvedDependencies.Value.Length);
827
+ Assert.Equal("Microsoft.CodeAnalysis.Compilers", resolvedDependencies.Value[0].Name);
828
+ Assert.Equal("4.10.0", resolvedDependencies.Value[0].Version);
829
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies.Value[1].Name);
830
+ Assert.Equal("4.10.0", resolvedDependencies.Value[1].Version);
831
+ Assert.Equal("Microsoft.CodeAnalysis.VisualBasic", resolvedDependencies.Value[2].Name);
832
+ Assert.Equal("4.10.0", resolvedDependencies.Value[2].Version);
833
833
  }
834
834
 
835
835
  // Updating referenced dependency
@@ -861,11 +861,11 @@ public class MSBuildHelperTests : TestBase
861
861
  new Dependency("Microsoft.CodeAnalysis.Common", "4.9.2", DependencyType.PackageReference),
862
862
  new Dependency("Microsoft.CodeAnalysis.CSharp", "4.9.2", DependencyType.PackageReference),
863
863
  new Dependency("Microsoft.CodeAnalysis.VisualBasic", "4.9.2", DependencyType.PackageReference)
864
- };
864
+ }.ToImmutableArray();
865
865
  var update = new[]
866
866
  {
867
867
  new Dependency("Microsoft.CodeAnalysis.Common", "4.10.0", DependencyType.PackageReference)
868
- };
868
+ }.ToImmutableArray();
869
869
 
870
870
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
871
871
  tempDirectory.DirectoryPath,
@@ -877,15 +877,15 @@ public class MSBuildHelperTests : TestBase
877
877
  new TestLogger()
878
878
  );
879
879
  Assert.NotNull(resolvedDependencies);
880
- Assert.Equal(4, resolvedDependencies.Length);
881
- Assert.Equal("Microsoft.CodeAnalysis.Compilers", resolvedDependencies[0].Name);
882
- Assert.Equal("4.10.0", resolvedDependencies[0].Version);
883
- Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies[1].Name);
884
- Assert.Equal("4.10.0", resolvedDependencies[1].Version);
885
- Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies[2].Name);
886
- Assert.Equal("4.10.0", resolvedDependencies[2].Version);
887
- Assert.Equal("Microsoft.CodeAnalysis.VisualBasic", resolvedDependencies[3].Name);
888
- Assert.Equal("4.10.0", resolvedDependencies[3].Version);
880
+ Assert.Equal(4, resolvedDependencies.Value.Length);
881
+ Assert.Equal("Microsoft.CodeAnalysis.Compilers", resolvedDependencies.Value[0].Name);
882
+ Assert.Equal("4.10.0", resolvedDependencies.Value[0].Version);
883
+ Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies.Value[1].Name);
884
+ Assert.Equal("4.10.0", resolvedDependencies.Value[1].Version);
885
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies.Value[2].Name);
886
+ Assert.Equal("4.10.0", resolvedDependencies.Value[2].Version);
887
+ Assert.Equal("Microsoft.CodeAnalysis.VisualBasic", resolvedDependencies.Value[3].Name);
888
+ Assert.Equal("4.10.0", resolvedDependencies.Value[3].Version);
889
889
  }
890
890
 
891
891
  // A combination of the third and fourth test, to measure efficiency of updating separate families
@@ -918,12 +918,12 @@ public class MSBuildHelperTests : TestBase
918
918
  new Dependency("Microsoft.CodeAnalysis.CSharp", "4.9.2", DependencyType.PackageReference),
919
919
  new Dependency("Microsoft.CodeAnalysis.VisualBasic", "4.9.2", DependencyType.PackageReference),
920
920
  new Dependency("Newtonsoft.Json.Bson", "1.0.2", DependencyType.PackageReference)
921
- };
921
+ }.ToImmutableArray();
922
922
  var update = new[]
923
923
  {
924
924
  new Dependency("Microsoft.CodeAnalysis.Common", "4.10.0", DependencyType.PackageReference),
925
925
  new Dependency("Newtonsoft.Json", "13.0.1", DependencyType.Unknown)
926
- };
926
+ }.ToImmutableArray();
927
927
 
928
928
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
929
929
  tempDirectory.DirectoryPath,
@@ -935,17 +935,17 @@ public class MSBuildHelperTests : TestBase
935
935
  new TestLogger()
936
936
  );
937
937
  Assert.NotNull(resolvedDependencies);
938
- Assert.Equal(5, resolvedDependencies.Length);
939
- Assert.Equal("Microsoft.CodeAnalysis.Compilers", resolvedDependencies[0].Name);
940
- Assert.Equal("4.10.0", resolvedDependencies[0].Version);
941
- Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies[1].Name);
942
- Assert.Equal("4.10.0", resolvedDependencies[1].Version);
943
- Assert.Equal("Microsoft.CodeAnalysis.VisualBasic", resolvedDependencies[2].Name);
944
- Assert.Equal("4.10.0", resolvedDependencies[2].Version);
945
- Assert.Equal("Newtonsoft.Json.Bson", resolvedDependencies[3].Name);
946
- Assert.Equal("1.0.2", resolvedDependencies[3].Version);
947
- Assert.Equal("Newtonsoft.Json", resolvedDependencies[4].Name);
948
- Assert.Equal("13.0.1", resolvedDependencies[4].Version);
938
+ Assert.Equal(5, resolvedDependencies.Value.Length);
939
+ Assert.Equal("Microsoft.CodeAnalysis.Compilers", resolvedDependencies.Value[0].Name);
940
+ Assert.Equal("4.10.0", resolvedDependencies.Value[0].Version);
941
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies.Value[1].Name);
942
+ Assert.Equal("4.10.0", resolvedDependencies.Value[1].Version);
943
+ Assert.Equal("Microsoft.CodeAnalysis.VisualBasic", resolvedDependencies.Value[2].Name);
944
+ Assert.Equal("4.10.0", resolvedDependencies.Value[2].Version);
945
+ Assert.Equal("Newtonsoft.Json.Bson", resolvedDependencies.Value[3].Name);
946
+ Assert.Equal("1.0.2", resolvedDependencies.Value[3].Version);
947
+ Assert.Equal("Newtonsoft.Json", resolvedDependencies.Value[4].Name);
948
+ Assert.Equal("13.0.1", resolvedDependencies.Value[4].Version);
949
949
  }
950
950
 
951
951
  // Two top level packages (Buildalyzer), (Microsoft.CodeAnalysis.CSharp.Scripting) that share a dependency (Microsoft.CodeAnalysis.Csharp)
@@ -995,11 +995,11 @@ public class MSBuildHelperTests : TestBase
995
995
  new Dependency("Microsoft.CodeAnalysis.CSharp.Scripting", "3.10.0", DependencyType.PackageReference),
996
996
  new Dependency("Microsoft.CodeAnalysis.CSharp", "3.10.0", DependencyType.PackageReference),
997
997
  new Dependency("Microsoft.CodeAnalysis.Common", "3.10.0", DependencyType.PackageReference),
998
- };
998
+ }.ToImmutableArray();
999
999
  var update = new[]
1000
1000
  {
1001
1001
  new Dependency("Buildalyzer", "7.0.1", DependencyType.PackageReference),
1002
- };
1002
+ }.ToImmutableArray();
1003
1003
 
1004
1004
  // act
1005
1005
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
@@ -1021,7 +1021,7 @@ public class MSBuildHelperTests : TestBase
1021
1021
  "Microsoft.CodeAnalysis.Common/4.0.1"
1022
1022
  };
1023
1023
  Assert.NotNull(resolvedDependencies);
1024
- var actualDependencies = resolvedDependencies.Select(d => $"{d.Name}/{d.Version}").ToArray();
1024
+ var actualDependencies = resolvedDependencies.Value.Select(d => $"{d.Name}/{d.Version}").ToArray();
1025
1025
  AssertEx.Equal(expectedDependencies, actualDependencies);
1026
1026
  }
1027
1027
 
@@ -1055,13 +1055,12 @@ public class MSBuildHelperTests : TestBase
1055
1055
  new Dependency("Microsoft.CodeAnalysis.CSharp.Scripting", "4.8.0", DependencyType.PackageReference),
1056
1056
  new Dependency("Microsoft.Bcl.AsyncInterfaces", "1.0.0", DependencyType.Unknown),
1057
1057
  new Dependency("Azure.Core", "1.21.0", DependencyType.PackageReference),
1058
-
1059
- };
1058
+ }.ToImmutableArray();
1060
1059
  var update = new[]
1061
1060
  {
1062
1061
  new Dependency("Microsoft.CodeAnalysis.Common", "4.10.0", DependencyType.PackageReference),
1063
1062
  new Dependency("Azure.Core", "1.22.0", DependencyType.PackageReference)
1064
- };
1063
+ }.ToImmutableArray();
1065
1064
 
1066
1065
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1067
1066
  tempDirectory.DirectoryPath,
@@ -1073,15 +1072,15 @@ public class MSBuildHelperTests : TestBase
1073
1072
  new TestLogger()
1074
1073
  );
1075
1074
  Assert.NotNull(resolvedDependencies);
1076
- Assert.Equal(4, resolvedDependencies.Length);
1077
- Assert.Equal("System.Collections.Immutable", resolvedDependencies[0].Name);
1078
- Assert.Equal("8.0.0", resolvedDependencies[0].Version);
1079
- Assert.Equal("Microsoft.CodeAnalysis.CSharp.Scripting", resolvedDependencies[1].Name);
1080
- Assert.Equal("4.10.0", resolvedDependencies[1].Version);
1081
- Assert.Equal("Microsoft.Bcl.AsyncInterfaces", resolvedDependencies[2].Name);
1082
- Assert.Equal("1.1.1", resolvedDependencies[2].Version);
1083
- Assert.Equal("Azure.Core", resolvedDependencies[3].Name);
1084
- Assert.Equal("1.22.0", resolvedDependencies[3].Version);
1075
+ Assert.Equal(4, resolvedDependencies.Value.Length);
1076
+ Assert.Equal("System.Collections.Immutable", resolvedDependencies.Value[0].Name);
1077
+ Assert.Equal("8.0.0", resolvedDependencies.Value[0].Version);
1078
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp.Scripting", resolvedDependencies.Value[1].Name);
1079
+ Assert.Equal("4.10.0", resolvedDependencies.Value[1].Version);
1080
+ Assert.Equal("Microsoft.Bcl.AsyncInterfaces", resolvedDependencies.Value[2].Name);
1081
+ Assert.Equal("1.1.1", resolvedDependencies.Value[2].Version);
1082
+ Assert.Equal("Azure.Core", resolvedDependencies.Value[3].Name);
1083
+ Assert.Equal("1.22.0", resolvedDependencies.Value[3].Version);
1085
1084
  }
1086
1085
 
1087
1086
  // Similar to the last test, except Microsoft.CodeAnalysis.Common is in the existing list
@@ -1115,12 +1114,12 @@ public class MSBuildHelperTests : TestBase
1115
1114
  new Dependency("Microsoft.Bcl.AsyncInterfaces", "1.0.0", DependencyType.Unknown),
1116
1115
  new Dependency("Azure.Core", "1.21.0", DependencyType.PackageReference),
1117
1116
 
1118
- };
1117
+ }.ToImmutableArray();
1119
1118
  var update = new[]
1120
1119
  {
1121
1120
  new Dependency("Microsoft.CodeAnalysis.Common", "4.10.0", DependencyType.PackageReference),
1122
1121
  new Dependency("Azure.Core", "1.22.0", DependencyType.PackageReference)
1123
- };
1122
+ }.ToImmutableArray();
1124
1123
 
1125
1124
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1126
1125
  tempDirectory.DirectoryPath,
@@ -1132,17 +1131,17 @@ public class MSBuildHelperTests : TestBase
1132
1131
  new TestLogger()
1133
1132
  );
1134
1133
  Assert.NotNull(resolvedDependencies);
1135
- Assert.Equal(5, resolvedDependencies.Length);
1136
- Assert.Equal("System.Collections.Immutable", resolvedDependencies[0].Name);
1137
- Assert.Equal("8.0.0", resolvedDependencies[0].Version);
1138
- Assert.Equal("Microsoft.CodeAnalysis.CSharp.Scripting", resolvedDependencies[1].Name);
1139
- Assert.Equal("4.10.0", resolvedDependencies[1].Version);
1140
- Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies[2].Name);
1141
- Assert.Equal("4.10.0", resolvedDependencies[2].Version);
1142
- Assert.Equal("Microsoft.Bcl.AsyncInterfaces", resolvedDependencies[3].Name);
1143
- Assert.Equal("1.1.1", resolvedDependencies[3].Version);
1144
- Assert.Equal("Azure.Core", resolvedDependencies[4].Name);
1145
- Assert.Equal("1.22.0", resolvedDependencies[4].Version);
1134
+ Assert.Equal(5, resolvedDependencies.Value.Length);
1135
+ Assert.Equal("System.Collections.Immutable", resolvedDependencies.Value[0].Name);
1136
+ Assert.Equal("8.0.0", resolvedDependencies.Value[0].Version);
1137
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp.Scripting", resolvedDependencies.Value[1].Name);
1138
+ Assert.Equal("4.10.0", resolvedDependencies.Value[1].Version);
1139
+ Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies.Value[2].Name);
1140
+ Assert.Equal("4.10.0", resolvedDependencies.Value[2].Version);
1141
+ Assert.Equal("Microsoft.Bcl.AsyncInterfaces", resolvedDependencies.Value[3].Name);
1142
+ Assert.Equal("1.1.1", resolvedDependencies.Value[3].Version);
1143
+ Assert.Equal("Azure.Core", resolvedDependencies.Value[4].Name);
1144
+ Assert.Equal("1.22.0", resolvedDependencies.Value[4].Version);
1146
1145
  }
1147
1146
 
1148
1147
  // Out of scope test: AutoMapper.Extensions.Microsoft.DependencyInjection's versions are not yet compatible
@@ -1173,11 +1172,11 @@ public class MSBuildHelperTests : TestBase
1173
1172
  new Dependency("AutoMapper.Extensions.Microsoft.DependencyInjection", "12.0.1", DependencyType.PackageReference),
1174
1173
  new Dependency("AutoMapper", "12.0.1", DependencyType.PackageReference),
1175
1174
  new Dependency("AutoMapper.Collection", "9.0.0", DependencyType.PackageReference)
1176
- };
1175
+ }.ToImmutableArray();
1177
1176
  var update = new[]
1178
1177
  {
1179
1178
  new Dependency("AutoMapper.Collection", "10.0.0", DependencyType.PackageReference)
1180
- };
1179
+ }.ToImmutableArray();
1181
1180
 
1182
1181
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1183
1182
  tempDirectory.DirectoryPath,
@@ -1189,13 +1188,13 @@ public class MSBuildHelperTests : TestBase
1189
1188
  new TestLogger()
1190
1189
  );
1191
1190
  Assert.NotNull(resolvedDependencies);
1192
- Assert.Equal(3, resolvedDependencies.Length);
1193
- Assert.Equal("AutoMapper.Extensions.Microsoft.DependencyInjection", resolvedDependencies[0].Name);
1194
- Assert.Equal("12.0.1", resolvedDependencies[0].Version);
1195
- Assert.Equal("AutoMapper", resolvedDependencies[1].Name);
1196
- Assert.Equal("12.0.1", resolvedDependencies[1].Version);
1197
- Assert.Equal("AutoMapper.Collection", resolvedDependencies[2].Name);
1198
- Assert.Equal("9.0.0", resolvedDependencies[2].Version);
1191
+ Assert.Equal(3, resolvedDependencies.Value.Length);
1192
+ Assert.Equal("AutoMapper.Extensions.Microsoft.DependencyInjection", resolvedDependencies.Value[0].Name);
1193
+ Assert.Equal("12.0.1", resolvedDependencies.Value[0].Version);
1194
+ Assert.Equal("AutoMapper", resolvedDependencies.Value[1].Name);
1195
+ Assert.Equal("12.0.1", resolvedDependencies.Value[1].Version);
1196
+ Assert.Equal("AutoMapper.Collection", resolvedDependencies.Value[2].Name);
1197
+ Assert.Equal("9.0.0", resolvedDependencies.Value[2].Version);
1199
1198
  }
1200
1199
 
1201
1200
  // Two dependencies (Microsoft.Extensions.Caching.Memory), (Microsoft.EntityFrameworkCore.Analyzers) used by the same parent (Microsoft.EntityFrameworkCore), updating one of the dependencies
@@ -1222,11 +1221,11 @@ public class MSBuildHelperTests : TestBase
1222
1221
  {
1223
1222
  new Dependency("Microsoft.EntityFrameworkCore", "7.0.11", DependencyType.PackageReference),
1224
1223
  new Dependency("Microsoft.EntityFrameworkCore.Analyzers", "7.0.11", DependencyType.PackageReference)
1225
- };
1224
+ }.ToImmutableArray();
1226
1225
  var update = new[]
1227
1226
  {
1228
1227
  new Dependency("Microsoft.Extensions.Caching.Memory", "8.0.0", DependencyType.PackageReference)
1229
- };
1228
+ }.ToImmutableArray();
1230
1229
 
1231
1230
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1232
1231
  tempDirectory.DirectoryPath,
@@ -1238,11 +1237,11 @@ public class MSBuildHelperTests : TestBase
1238
1237
  new TestLogger()
1239
1238
  );
1240
1239
  Assert.NotNull(resolvedDependencies);
1241
- Assert.Equal(2, resolvedDependencies.Length);
1242
- Assert.Equal("Microsoft.EntityFrameworkCore", resolvedDependencies[0].Name);
1243
- Assert.Equal("8.0.0", resolvedDependencies[0].Version);
1244
- Assert.Equal("Microsoft.EntityFrameworkCore.Analyzers", resolvedDependencies[1].Name);
1245
- Assert.Equal("8.0.0", resolvedDependencies[1].Version);
1240
+ Assert.Equal(2, resolvedDependencies.Value.Length);
1241
+ Assert.Equal("Microsoft.EntityFrameworkCore", resolvedDependencies.Value[0].Name);
1242
+ Assert.Equal("8.0.0", resolvedDependencies.Value[0].Version);
1243
+ Assert.Equal("Microsoft.EntityFrameworkCore.Analyzers", resolvedDependencies.Value[1].Name);
1244
+ Assert.Equal("8.0.0", resolvedDependencies.Value[1].Version);
1246
1245
  }
1247
1246
 
1248
1247
  // Updating referenced package
@@ -1274,11 +1273,11 @@ public class MSBuildHelperTests : TestBase
1274
1273
  new Dependency("Microsoft.EntityFrameworkCore.Relational", "7.0.0", DependencyType.PackageReference),
1275
1274
  new Dependency("Microsoft.EntityFrameworkCore", "7.0.0", DependencyType.PackageReference),
1276
1275
  new Dependency("Microsoft.EntityFrameworkCore.Analyzers", "7.0.0", DependencyType.PackageReference)
1277
- };
1276
+ }.ToImmutableArray();
1278
1277
  var update = new[]
1279
1278
  {
1280
1279
  new Dependency("Microsoft.EntityFrameworkCore.Analyzers", "8.0.0", DependencyType.PackageReference)
1281
- };
1280
+ }.ToImmutableArray();
1282
1281
 
1283
1282
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1284
1283
  tempDirectory.DirectoryPath,
@@ -1290,15 +1289,15 @@ public class MSBuildHelperTests : TestBase
1290
1289
  new TestLogger()
1291
1290
  );
1292
1291
  Assert.NotNull(resolvedDependencies);
1293
- Assert.Equal(4, resolvedDependencies.Length);
1294
- Assert.Equal("Microsoft.EntityFrameworkCore.Design", resolvedDependencies[0].Name);
1295
- Assert.Equal("7.0.0", resolvedDependencies[0].Version);
1296
- Assert.Equal("Microsoft.EntityFrameworkCore.Relational", resolvedDependencies[1].Name);
1297
- Assert.Equal("7.0.0", resolvedDependencies[1].Version);
1298
- Assert.Equal("Microsoft.EntityFrameworkCore", resolvedDependencies[2].Name);
1299
- Assert.Equal("7.0.0", resolvedDependencies[2].Version);
1300
- Assert.Equal("Microsoft.EntityFrameworkCore.Analyzers", resolvedDependencies[3].Name);
1301
- Assert.Equal("8.0.0", resolvedDependencies[3].Version);
1292
+ Assert.Equal(4, resolvedDependencies.Value.Length);
1293
+ Assert.Equal("Microsoft.EntityFrameworkCore.Design", resolvedDependencies.Value[0].Name);
1294
+ Assert.Equal("7.0.0", resolvedDependencies.Value[0].Version);
1295
+ Assert.Equal("Microsoft.EntityFrameworkCore.Relational", resolvedDependencies.Value[1].Name);
1296
+ Assert.Equal("7.0.0", resolvedDependencies.Value[1].Version);
1297
+ Assert.Equal("Microsoft.EntityFrameworkCore", resolvedDependencies.Value[2].Name);
1298
+ Assert.Equal("7.0.0", resolvedDependencies.Value[2].Version);
1299
+ Assert.Equal("Microsoft.EntityFrameworkCore.Analyzers", resolvedDependencies.Value[3].Name);
1300
+ Assert.Equal("8.0.0", resolvedDependencies.Value[3].Version);
1302
1301
  }
1303
1302
 
1304
1303
  // Updating unreferenced package
@@ -1328,11 +1327,11 @@ public class MSBuildHelperTests : TestBase
1328
1327
  new Dependency("Microsoft.EntityFrameworkCore.Design", "7.0.0", DependencyType.PackageReference),
1329
1328
  new Dependency("Microsoft.EntityFrameworkCore.Relational", "7.0.0", DependencyType.PackageReference),
1330
1329
  new Dependency("Microsoft.EntityFrameworkCore", "7.0.0", DependencyType.PackageReference),
1331
- };
1330
+ }.ToImmutableArray();
1332
1331
  var update = new[]
1333
1332
  {
1334
1333
  new Dependency("Microsoft.EntityFrameworkCore.Analyzers", "8.0.0", DependencyType.PackageReference)
1335
- };
1334
+ }.ToImmutableArray();
1336
1335
 
1337
1336
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1338
1337
  tempDirectory.DirectoryPath,
@@ -1344,13 +1343,13 @@ public class MSBuildHelperTests : TestBase
1344
1343
  new TestLogger()
1345
1344
  );
1346
1345
  Assert.NotNull(resolvedDependencies);
1347
- Assert.Equal(3, resolvedDependencies.Length);
1348
- Assert.Equal("Microsoft.EntityFrameworkCore.Design", resolvedDependencies[0].Name);
1349
- Assert.Equal("8.0.0", resolvedDependencies[0].Version);
1350
- Assert.Equal("Microsoft.EntityFrameworkCore.Relational", resolvedDependencies[1].Name);
1351
- Assert.Equal("8.0.0", resolvedDependencies[1].Version);
1352
- Assert.Equal("Microsoft.EntityFrameworkCore", resolvedDependencies[2].Name);
1353
- Assert.Equal("8.0.0", resolvedDependencies[2].Version);
1346
+ Assert.Equal(3, resolvedDependencies.Value.Length);
1347
+ Assert.Equal("Microsoft.EntityFrameworkCore.Design", resolvedDependencies.Value[0].Name);
1348
+ Assert.Equal("8.0.0", resolvedDependencies.Value[0].Version);
1349
+ Assert.Equal("Microsoft.EntityFrameworkCore.Relational", resolvedDependencies.Value[1].Name);
1350
+ Assert.Equal("8.0.0", resolvedDependencies.Value[1].Version);
1351
+ Assert.Equal("Microsoft.EntityFrameworkCore", resolvedDependencies.Value[2].Name);
1352
+ Assert.Equal("8.0.0", resolvedDependencies.Value[2].Version);
1354
1353
  }
1355
1354
 
1356
1355
  // Updating a referenced transitive dependency
@@ -1382,11 +1381,11 @@ public class MSBuildHelperTests : TestBase
1382
1381
  new Dependency("Microsoft.CodeAnalysis.CSharp.Workspaces", "4.8.0", DependencyType.PackageReference),
1383
1382
  new Dependency("Microsoft.CodeAnalysis.CSharp", "4.8.0", DependencyType.PackageReference),
1384
1383
  new Dependency("Microsoft.CodeAnalysis.Common", "4.8.0", DependencyType.PackageReference),
1385
- };
1384
+ }.ToImmutableArray();
1386
1385
  var update = new[]
1387
1386
  {
1388
1387
  new Dependency("System.Collections.Immutable", "8.0.0", DependencyType.PackageReference),
1389
- };
1388
+ }.ToImmutableArray();
1390
1389
 
1391
1390
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1392
1391
  tempDirectory.DirectoryPath,
@@ -1398,15 +1397,15 @@ public class MSBuildHelperTests : TestBase
1398
1397
  new TestLogger()
1399
1398
  );
1400
1399
  Assert.NotNull(resolvedDependencies);
1401
- Assert.Equal(4, resolvedDependencies.Length);
1402
- Assert.Equal("System.Collections.Immutable", resolvedDependencies[0].Name);
1403
- Assert.Equal("8.0.0", resolvedDependencies[0].Version);
1404
- Assert.Equal("Microsoft.CodeAnalysis.CSharp.Workspaces", resolvedDependencies[1].Name);
1405
- Assert.Equal("4.8.0", resolvedDependencies[1].Version);
1406
- Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies[2].Name);
1407
- Assert.Equal("4.8.0", resolvedDependencies[2].Version);
1408
- Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies[3].Name);
1409
- Assert.Equal("4.8.0", resolvedDependencies[3].Version);
1400
+ Assert.Equal(4, resolvedDependencies.Value.Length);
1401
+ Assert.Equal("System.Collections.Immutable", resolvedDependencies.Value[0].Name);
1402
+ Assert.Equal("8.0.0", resolvedDependencies.Value[0].Version);
1403
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp.Workspaces", resolvedDependencies.Value[1].Name);
1404
+ Assert.Equal("4.8.0", resolvedDependencies.Value[1].Version);
1405
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies.Value[2].Name);
1406
+ Assert.Equal("4.8.0", resolvedDependencies.Value[2].Version);
1407
+ Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies.Value[3].Name);
1408
+ Assert.Equal("4.8.0", resolvedDependencies.Value[3].Version);
1410
1409
  }
1411
1410
 
1412
1411
  // Similar to the last test, with the "grandchild" (System.Collections.Immutable) not in the existing list
@@ -1435,12 +1434,11 @@ public class MSBuildHelperTests : TestBase
1435
1434
  new Dependency("Microsoft.CodeAnalysis.CSharp.Workspaces", "4.8.0", DependencyType.PackageReference),
1436
1435
  new Dependency("Microsoft.CodeAnalysis.CSharp", "4.8.0", DependencyType.PackageReference),
1437
1436
  new Dependency("Microsoft.CodeAnalysis.Common", "4.8.0", DependencyType.PackageReference),
1438
-
1439
- };
1437
+ }.ToImmutableArray();
1440
1438
  var update = new[]
1441
1439
  {
1442
1440
  new Dependency("System.Collections.Immutable", "8.0.0", DependencyType.PackageReference),
1443
- };
1441
+ }.ToImmutableArray();
1444
1442
 
1445
1443
  var resolvedDependencies = await MSBuildHelper.ResolveDependencyConflicts(
1446
1444
  tempDirectory.DirectoryPath,
@@ -1452,13 +1450,13 @@ public class MSBuildHelperTests : TestBase
1452
1450
  new TestLogger()
1453
1451
  );
1454
1452
  Assert.NotNull(resolvedDependencies);
1455
- Assert.Equal(3, resolvedDependencies.Length);
1456
- Assert.Equal("Microsoft.CodeAnalysis.CSharp.Workspaces", resolvedDependencies[0].Name);
1457
- Assert.Equal("4.9.2", resolvedDependencies[0].Version);
1458
- Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies[1].Name);
1459
- Assert.Equal("4.9.2", resolvedDependencies[1].Version);
1460
- Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies[2].Name);
1461
- Assert.Equal("4.9.2", resolvedDependencies[2].Version);
1453
+ Assert.Equal(3, resolvedDependencies.Value.Length);
1454
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp.Workspaces", resolvedDependencies.Value[0].Name);
1455
+ Assert.Equal("4.9.2", resolvedDependencies.Value[0].Version);
1456
+ Assert.Equal("Microsoft.CodeAnalysis.CSharp", resolvedDependencies.Value[1].Name);
1457
+ Assert.Equal("4.9.2", resolvedDependencies.Value[1].Version);
1458
+ Assert.Equal("Microsoft.CodeAnalysis.Common", resolvedDependencies.Value[2].Name);
1459
+ Assert.Equal("4.9.2", resolvedDependencies.Value[2].Version);
1462
1460
  }
1463
1461
  #endregion
1464
1462