From 53f3c96c191b73d8aab1d753ecae2c81e918f2e4 Mon Sep 17 00:00:00 2001 From: Tomer Rosenthal Date: Sun, 23 Nov 2025 21:17:57 -0800 Subject: [PATCH 1/3] Update project to support .NET 6.0 alongside .NET 8.0 and .NET 10, and adjust build configurations --- Directory.Build.props | 6 ++-- eng/templates/build.yml | 6 ++++ .../AzureManaged/Client.AzureManaged.csproj | 2 +- src/ScheduledTasks/ScheduledTasks.csproj | 2 +- .../AzureManaged/Worker.AzureManaged.csproj | 2 +- .../Client.AzureManaged.Tests.csproj | 2 +- test/Generators.Tests/Generators.Tests.csproj | 2 +- .../Utils/CSharpSourceGeneratorVerifier.cs | 30 +++++++++++++++---- .../ScheduledTasks.Tests.csproj | 2 +- .../Worker.AzureManaged.Tests.csproj | 2 +- .../Grpc.Tests/Worker.Grpc.Tests.csproj | 2 +- 11 files changed, 43 insertions(+), 15 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 644af0ec..88170bea 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -23,8 +23,10 @@ $(RepoRoot)src/ $(OutRoot)bin/ $(OutRoot)obj/$(MSBuildProjectName)/ - $(BaseIntermediateOutputPath)$(Configuration)/ - $(MSBuildProjectName)/ + $([MSBuild]::EnsureTrailingSlash($(TargetFramework))) + + $(BaseIntermediateOutputPath)$(Configuration)/$(TargetSpecificSubPath) + $(MSBuildProjectName)/$(TargetSpecificSubPath) $(BaseOutputPath)$(Configuration)/$([MSBuild]::EnsureTrailingSlash($(SubOutputPath))) $(OutRoot)pkg/ diff --git a/eng/templates/build.yml b/eng/templates/build.yml index a94d3aff..4b6112e0 100644 --- a/eng/templates/build.yml +++ b/eng/templates/build.yml @@ -31,6 +31,12 @@ jobs: packageType: 'sdk' version: '6.x' + - task: UseDotNet@2 + displayName: 'Install .NET 8 SDK' + inputs: + packageType: 'sdk' + version: '8.x' + - task: UseDotNet@2 displayName: 'Install .NET SDK (Build)' # This is needed for the build. inputs: diff --git a/src/Client/AzureManaged/Client.AzureManaged.csproj b/src/Client/AzureManaged/Client.AzureManaged.csproj index 78fa3ad5..7dd459f3 100644 --- a/src/Client/AzureManaged/Client.AzureManaged.csproj +++ b/src/Client/AzureManaged/Client.AzureManaged.csproj @@ -1,7 +1,7 @@  - net8.0;net10.0 + net6.0;net8.0;net10.0 Azure Managed extensions for the Durable Task Framework client. true diff --git a/src/ScheduledTasks/ScheduledTasks.csproj b/src/ScheduledTasks/ScheduledTasks.csproj index 5971a560..3126851b 100644 --- a/src/ScheduledTasks/ScheduledTasks.csproj +++ b/src/ScheduledTasks/ScheduledTasks.csproj @@ -1,7 +1,7 @@  - net8.0;net10.0 + net6.0;net8.0;net10.0 Durable Task Scheduled Tasks Client true preview.1 diff --git a/src/Worker/AzureManaged/Worker.AzureManaged.csproj b/src/Worker/AzureManaged/Worker.AzureManaged.csproj index 0eea5a5d..e433b192 100644 --- a/src/Worker/AzureManaged/Worker.AzureManaged.csproj +++ b/src/Worker/AzureManaged/Worker.AzureManaged.csproj @@ -1,7 +1,7 @@  - net8.0;net10.0 + net6.0;net8.0;net10.0 Azure Managed extensions for the Durable Task Framework worker. true diff --git a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj index 77928b51..01f27c92 100644 --- a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj +++ b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj @@ -1,7 +1,7 @@ - net8.0;net10.0 + net6.0;net8.0;net10.0 diff --git a/test/Generators.Tests/Generators.Tests.csproj b/test/Generators.Tests/Generators.Tests.csproj index 55aba3ea..86ff0c84 100644 --- a/test/Generators.Tests/Generators.Tests.csproj +++ b/test/Generators.Tests/Generators.Tests.csproj @@ -1,7 +1,7 @@  - net8.0;net10.0 + net6.0;net8.0;net10.0 diff --git a/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs b/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs index 331ebd14..0770889c 100644 --- a/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs +++ b/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs @@ -1,7 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System; using System.Collections.Immutable; +using System.IO; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Testing; @@ -16,11 +18,7 @@ public class Test : CSharpSourceGeneratorTest { public Test() { - // See https://www.nuget.org/packages/Microsoft.NETCore.App.Ref/8.0.22 - this.ReferenceAssemblies = new ReferenceAssemblies( - targetFramework: "net8.0", - referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "8.0.22"), - referenceAssemblyPath: Path.Combine("ref", "net8.0")); + this.ReferenceAssemblies = CreateReferenceAssembliesForTargetFramework(); } public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.CSharp9; @@ -48,5 +46,27 @@ protected override ParseOptions CreateParseOptions() { return ((CSharpParseOptions)base.CreateParseOptions()).WithLanguageVersion(this.LanguageVersion); } + + static ReferenceAssemblies CreateReferenceAssembliesForTargetFramework() + { +#if NET10_0_OR_GREATER + return new ReferenceAssemblies( + targetFramework: "net10.0", + referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "10.0.0"), + referenceAssemblyPath: Path.Combine("ref", "net10.0")); +#elif NET8_0_OR_GREATER + return new ReferenceAssemblies( + targetFramework: "net8.0", + referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "8.0.22"), + referenceAssemblyPath: Path.Combine("ref", "net8.0")); +#elif NET6_0_OR_GREATER + return new ReferenceAssemblies( + targetFramework: "net6.0", + referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "6.0.36"), + referenceAssemblyPath: Path.Combine("ref", "net6.0")); +#else + throw new NotSupportedException("Unsupported target framework for generator tests."); +#endif + } } } diff --git a/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj b/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj index 3f788c51..34e026cc 100644 --- a/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj +++ b/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj @@ -2,7 +2,7 @@ - net8.0;net10.0 + net6.0;net8.0;net10.0 enable enable false diff --git a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj index fc933611..9fe9ec68 100644 --- a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj +++ b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj @@ -1,7 +1,7 @@ - net8.0;net10.0 + net6.0;net8.0;net10.0 diff --git a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj index 32d83f45..e60572c5 100644 --- a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj +++ b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj @@ -1,7 +1,7 @@ - net8.0;net10.0;net48 + net6.0;net8.0;net10.0;net48 From 9f655e3f15936b7b7fdc2033eca661b45a65a885 Mon Sep 17 00:00:00 2001 From: Tomer Rosenthal Date: Mon, 24 Nov 2025 12:51:15 -0800 Subject: [PATCH 2/3] Update tests --- test/Abstractions.Tests/Abstractions.Tests.csproj | 2 +- test/Analyzers.Tests/Analyzers.Tests.csproj | 2 +- test/Benchmarks/Benchmarks.csproj | 2 +- .../Client.AzureManaged.Tests.csproj | 2 +- test/Client/Core.Tests/Client.Tests.csproj | 2 +- test/Client/Grpc.Tests/Client.Grpc.Tests.csproj | 2 +- ...ent.OrchestrationServiceClientShim.Tests.csproj | 2 +- test/Generators.Tests/Generators.Tests.csproj | 2 +- .../Utils/CSharpSourceGeneratorVerifier.cs | 14 -------------- .../Grpc.IntegrationTests.csproj | 2 +- .../InProcessTestHost.Tests.csproj | 2 +- .../ScheduledTasks.Tests.csproj | 2 +- .../Shared.AzureManaged.Tests.csproj | 2 +- test/TestHelpers/TestHelpers.csproj | 2 +- .../Worker.AzureManaged.Tests.csproj | 2 +- test/Worker/Core.Tests/Worker.Tests.csproj | 2 +- test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj | 2 +- 17 files changed, 16 insertions(+), 30 deletions(-) diff --git a/test/Abstractions.Tests/Abstractions.Tests.csproj b/test/Abstractions.Tests/Abstractions.Tests.csproj index 1e10da3c..9e3b1ad5 100644 --- a/test/Abstractions.Tests/Abstractions.Tests.csproj +++ b/test/Abstractions.Tests/Abstractions.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Analyzers.Tests/Analyzers.Tests.csproj b/test/Analyzers.Tests/Analyzers.Tests.csproj index e93d9c6d..4a8c8c4b 100644 --- a/test/Analyzers.Tests/Analyzers.Tests.csproj +++ b/test/Analyzers.Tests/Analyzers.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Benchmarks/Benchmarks.csproj b/test/Benchmarks/Benchmarks.csproj index b7657682..3101371c 100644 --- a/test/Benchmarks/Benchmarks.csproj +++ b/test/Benchmarks/Benchmarks.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0;net10.0 + net10.0 Exe Benchmarks diff --git a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj index 01f27c92..ba569a77 100644 --- a/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj +++ b/test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Client/Core.Tests/Client.Tests.csproj b/test/Client/Core.Tests/Client.Tests.csproj index a8790ba5..3b416c26 100644 --- a/test/Client/Core.Tests/Client.Tests.csproj +++ b/test/Client/Core.Tests/Client.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj index 41c0667a..d21691d0 100644 --- a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj +++ b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0;net10.0;net48 + net10.0;net48 diff --git a/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj b/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj index c0899d09..8909324f 100644 --- a/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj +++ b/test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Generators.Tests/Generators.Tests.csproj b/test/Generators.Tests/Generators.Tests.csproj index 86ff0c84..61797770 100644 --- a/test/Generators.Tests/Generators.Tests.csproj +++ b/test/Generators.Tests/Generators.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs b/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs index 0770889c..2e2cf883 100644 --- a/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs +++ b/test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs @@ -49,24 +49,10 @@ protected override ParseOptions CreateParseOptions() static ReferenceAssemblies CreateReferenceAssembliesForTargetFramework() { -#if NET10_0_OR_GREATER return new ReferenceAssemblies( targetFramework: "net10.0", referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "10.0.0"), referenceAssemblyPath: Path.Combine("ref", "net10.0")); -#elif NET8_0_OR_GREATER - return new ReferenceAssemblies( - targetFramework: "net8.0", - referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "8.0.22"), - referenceAssemblyPath: Path.Combine("ref", "net8.0")); -#elif NET6_0_OR_GREATER - return new ReferenceAssemblies( - targetFramework: "net6.0", - referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "6.0.36"), - referenceAssemblyPath: Path.Combine("ref", "net6.0")); -#else - throw new NotSupportedException("Unsupported target framework for generator tests."); -#endif } } } diff --git a/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj b/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj index 08ec22e1..f891cc73 100644 --- a/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj +++ b/test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/InProcessTestHost.Tests/InProcessTestHost.Tests.csproj b/test/InProcessTestHost.Tests/InProcessTestHost.Tests.csproj index e2dbbe5e..96aa12ab 100644 --- a/test/InProcessTestHost.Tests/InProcessTestHost.Tests.csproj +++ b/test/InProcessTestHost.Tests/InProcessTestHost.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 enable enable diff --git a/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj b/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj index 34e026cc..c7aba768 100644 --- a/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj +++ b/test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj @@ -2,7 +2,7 @@ - net6.0;net8.0;net10.0 + net10.0 enable enable false diff --git a/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj b/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj index efd29a70..4599449b 100644 --- a/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj +++ b/test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/TestHelpers/TestHelpers.csproj b/test/TestHelpers/TestHelpers.csproj index f522d518..605c418a 100644 --- a/test/TestHelpers/TestHelpers.csproj +++ b/test/TestHelpers/TestHelpers.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0;net10.0;netstandard2.0 + net10.0;netstandard2.0 diff --git a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj index 9fe9ec68..9aab6f15 100644 --- a/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj +++ b/test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Worker/Core.Tests/Worker.Tests.csproj b/test/Worker/Core.Tests/Worker.Tests.csproj index b0fcd6bc..59263571 100644 --- a/test/Worker/Core.Tests/Worker.Tests.csproj +++ b/test/Worker/Core.Tests/Worker.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0 + net10.0 diff --git a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj index e60572c5..c07364c6 100644 --- a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj +++ b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0;net10.0;net48 + net10.0;net48 From b3e660ce57268e88241d00e3250ed6a9c09659a8 Mon Sep 17 00:00:00 2001 From: Tomer Rosenthal Date: Mon, 24 Nov 2025 13:03:24 -0800 Subject: [PATCH 3/3] Refactor project files to target .NET 10.0 exclusively, removing support for multiple target frameworks --- Directory.Build.props | 6 ++---- test/Client/Grpc.Tests/Client.Grpc.Tests.csproj | 2 +- test/TestHelpers/TestHelpers.csproj | 2 +- test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 88170bea..644af0ec 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -23,10 +23,8 @@ $(RepoRoot)src/ $(OutRoot)bin/ $(OutRoot)obj/$(MSBuildProjectName)/ - $([MSBuild]::EnsureTrailingSlash($(TargetFramework))) - - $(BaseIntermediateOutputPath)$(Configuration)/$(TargetSpecificSubPath) - $(MSBuildProjectName)/$(TargetSpecificSubPath) + $(BaseIntermediateOutputPath)$(Configuration)/ + $(MSBuildProjectName)/ $(BaseOutputPath)$(Configuration)/$([MSBuild]::EnsureTrailingSlash($(SubOutputPath))) $(OutRoot)pkg/ diff --git a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj index d21691d0..04a4f27a 100644 --- a/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj +++ b/test/Client/Grpc.Tests/Client.Grpc.Tests.csproj @@ -1,7 +1,7 @@  - net10.0;net48 + net10.0 diff --git a/test/TestHelpers/TestHelpers.csproj b/test/TestHelpers/TestHelpers.csproj index 605c418a..f2a65e9d 100644 --- a/test/TestHelpers/TestHelpers.csproj +++ b/test/TestHelpers/TestHelpers.csproj @@ -1,7 +1,7 @@  - net10.0;netstandard2.0 + net10.0 diff --git a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj index c07364c6..f17df96b 100644 --- a/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj +++ b/test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj @@ -1,7 +1,7 @@ - net10.0;net48 + net10.0