diff --git a/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommand.cs b/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommand.cs index db923840be7..2d2cfd37fd9 100644 --- a/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommand.cs +++ b/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommand.cs @@ -59,6 +59,8 @@ private readonly Dictionary value.Should().Be(1), ["RuntimeIdentifiersCount"] = value => value.Should().Be(0), ["TreatWarningsAsErrors"] = value => value.Should().Be(false), + ["SDKAnalysisLevel"] = value => value.Should().Be(null), + ["UsingMicrosoftNETSdk"] = value => value.Should().Be(false), }; HashSet actualProperties = new(); @@ -2926,6 +2928,8 @@ public async Task ExecuteAsync_WithSinglePackage_WhenNoOping_PopulatesCorrectTel var projectPath = Path.Combine(pathContext.SolutionRoot, projectName); PackageSpec packageSpec = ProjectTestHelpers.GetPackageSpec(projectName, pathContext.SolutionRoot, "net472", "a"); packageSpec.RestoreMetadata.ProjectWideWarningProperties.AllWarningsAsErrors = true; + packageSpec.RestoreMetadata.UsingMicrosoftNETSdk = true; + packageSpec.RestoreMetadata.SdkAnalysisLevel = NuGetVersion.Parse("9.0.100"); await SimpleTestPackageUtility.CreateFolderFeedV3Async( pathContext.PackageSource, @@ -2970,7 +2974,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( var projectInformationEvent = telemetryEvents.Single(e => e.Name.Equals("ProjectRestoreInformation")); - projectInformationEvent.Count.Should().Be(28); + projectInformationEvent.Count.Should().Be(30); projectInformationEvent["RestoreSuccess"].Should().Be(true); projectInformationEvent["NoOpResult"].Should().Be(true); projectInformationEvent["IsCentralVersionManagementEnabled"].Should().Be(false); @@ -2999,6 +3003,8 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( projectInformationEvent["TargetFrameworksCount"].Should().Be(1); projectInformationEvent["RuntimeIdentifiersCount"].Should().Be(0); projectInformationEvent["TreatWarningsAsErrors"].Should().Be(true); + projectInformationEvent["SDKAnalysisLevel"].Should().Be(NuGetVersion.Parse("9.0.100")); + projectInformationEvent["UsingMicrosoftNETSdk"].Should().Be(true); } [Fact] @@ -3056,7 +3062,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( var projectInformationEvent = telemetryEvents.Single(e => e.Name.Equals("ProjectRestoreInformation")); - projectInformationEvent.Count.Should().Be(34); + projectInformationEvent.Count.Should().Be(36); projectInformationEvent["RestoreSuccess"].Should().Be(true); projectInformationEvent["NoOpResult"].Should().Be(false); projectInformationEvent["TotalUniquePackagesCount"].Should().Be(2);