Update project to target .NET 8.0 and .NET 10 and upgrade dependencies#510
Update project to target .NET 8.0 and .NET 10 and upgrade dependencies#510
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the project from .NET 6.0 to .NET 8.0, updating all project files, dependencies, tooling configurations, and migrating source generators to use the incremental generator API. The migration enables access to .NET 8's long-term support, security improvements, and new features while maintaining backward compatibility through multi-targeting.
Key changes:
- Updated all project target frameworks from
net6.0tonet8.0, with multi-targeted projects now includingnet8.0alongsidenetstandard2.0andnet48 - Upgraded dependencies to .NET 8-compatible versions including Microsoft.Extensions., Azure., Grpc, and testing packages
- Migrated source generator from
ISourceGeneratortoIIncrementalGeneratorAPI for better performance and compatibility with .NET 8 tooling
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Worker/Grpc.Tests/Worker.Grpc.Tests.csproj | Updated target frameworks from net6.0;net48 to net8.0;net48 and conditional package reference condition |
| test/Worker/Core.Tests/Worker.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/Worker/AzureManaged.Tests/Worker.AzureManaged.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/TestHelpers/TestHelpers.csproj | Added net8.0 to multi-target frameworks alongside net6.0;netstandard2.0 |
| test/Shared/AzureManaged.Tests/Shared.AzureManaged.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/ScheduledTasks.Tests/ScheduledTasks.Tests.csproj | Updated target framework from net6.0 to net8.0 and removed explicit Microsoft.NET.Test.Sdk reference |
| test/Grpc.IntegrationTests/OrchestrationPatterns.cs | Added explicit cast to fix compilation issue with Assert.Equal generic method resolution |
| test/Grpc.IntegrationTests/Grpc.IntegrationTests.csproj | Updated target framework from net6.0 to net8.0 |
| test/Generators.Tests/Utils/TestHelpers.cs | Changed generic constraint from ISourceGenerator to IIncrementalGenerator and minor formatting fix |
| test/Generators.Tests/Utils/CSharpSourceGeneratorVerifier.cs | Updated generic constraint and reference assemblies from .NET 6.0 to .NET 8.0 |
| test/Generators.Tests/Generators.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/Client/OrchestrationServiceClientShim.Tests/Client.OrchestrationServiceClientShim.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/Client/Grpc.Tests/Client.Grpc.Tests.csproj | Updated target frameworks from net6.0;net48 to net8.0;net48 |
| test/Client/Core.Tests/Client.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/Client/AzureManaged.Tests/Client.AzureManaged.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/Benchmarks/Benchmarks.csproj | Updated target framework from net6.0 to net8.0 |
| test/Analyzers.Tests/Analyzers.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| test/Abstractions.Tests/Abstractions.Tests.csproj | Updated target framework from net6.0 to net8.0 |
| src/Worker/Grpc/Worker.Grpc.csproj | Updated target frameworks from netstandard2.0;net6.0 to netstandard2.0;net8.0 |
| src/Worker/AzureManaged/Worker.AzureManaged.csproj | Updated target framework from net6.0 to net8.0 |
| src/ScheduledTasks/ScheduledTasks.csproj | Updated target framework from net6.0 to net8.0 |
| src/InProcessTestHost/InProcessTestHost.csproj | Updated target framework from net6.0 to net8.0 |
| src/Grpc/Grpc.csproj | Updated target frameworks from netstandard2.0;net6.0 to netstandard2.0;net8.0 and conditional package reference condition |
| src/Generators/DurableTaskSourceGenerator.cs | Migrated from ISourceGenerator to IIncrementalGenerator API with complete rewrite of initialization and execution logic |
| src/Extensions/AzureBlobPayloads/AzureBlobPayloads.csproj | Updated target frameworks from netstandard2.0;net6.0 to netstandard2.0;net8.0 |
| src/Client/Grpc/Client.Grpc.csproj | Updated target frameworks from netstandard2.0;net6.0 to netstandard2.0;net8.0 |
| src/Client/AzureManaged/Client.AzureManaged.csproj | Updated target framework from net6.0 to net8.0 |
| samples/WebAPI/WebAPI.csproj | Updated target framework from net6.0 to net8.0 |
| samples/ScheduleWebApp/ScheduleWebApp.csproj | Updated target framework from net6.0 to net8.0 |
| samples/AzureFunctionsApp/AzureFunctionsApp.csproj | Updated target framework from net6.0 to net8.0 |
| global.json | Updated .NET SDK version from 8.0.100 to 8.0.416 |
| Directory.Packages.props | Updated all package versions to .NET 8-compatible versions |
| .vscode/tasks.json | Updated output path from net6.0 to net8.0 for Azure Functions task |
| .github/workflows/validate-build.yml | Updated workflow to use .NET 8.0 instead of .NET 6.0 |
test/TestHelpers/TestHelpers.csproj
Outdated
|
|
||
| <PropertyGroup> | ||
| <TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks> | ||
| <TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks> |
There was a problem hiding this comment.
[nitpick] The target frameworks should be ordered from most specific to most general. The current order net8.0;net6.0;netstandard2.0 is correct, but since this is a shared test helper library, keeping net6.0 may not be necessary if all test projects are now targeting net8.0. Consider removing net6.0 to simplify the build matrix unless backward compatibility with .NET 6 test projects is explicitly required.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan * Remove net6.0 target from TestHelpers.csproj Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: torosent <17064840+torosent@users.noreply.github.com>
…urabletask-dotnet into torosent/update-net8
|
@jviau - I tried this change a while back and you flagged it as a breaking change. Do you know if we've updated/what we need to update to be able to do this? |
|
Dropping net6.0 TFM will introduce a breaking change to net6.0 customers. And a potentially obscure / difficult to identify one at that. Since these projects all multi-target There are a couple options to supporting net8.0:
Regardless of the choice made, I recommend also adding |
Thanks Jacob. I updated to support 6.0, 8.0 and 10.0 |
halspang
left a comment
There was a problem hiding this comment.
Minor comments/questions. Overall looks good!
…compatibility The Azure Functions host process runs on net8.0 and loads DurableTask extension assemblies into its process. Packages like Microsoft.Extensions.*, Bcl.AsyncInterfaces, and System.Text.Json are part of the .NET shared framework - the host only provides version 8.0.0.0 of these assemblies. PR #510 upgraded these to 10.x, which causes FileNotFoundException at runtime: Could not load file or assembly 'Microsoft.Extensions.Options, Version=10.0.0.0' This reverts the 11 shared-framework packages to 8.x while keeping all other dependency upgrades (Grpc, Protobuf, Azure.Storage.Blobs, Azure.Identity, etc). Packages reverted: - Microsoft.Extensions.* (9 packages): 10.0.2 -> 8.x - Microsoft.Bcl.AsyncInterfaces: 10.0.2 -> 8.0.0 - System.Text.Json: 10.0.2 -> 8.0.5 Test project fix: - Generators.Tests: VersionOverride for DependencyInjection (net10 test project needs 10.x via Functions.Worker transitive dep, safe since tests don't load into the Functions host) global.json: relaxed SDK version to match installed 10.0.104
…compatibility The Azure Functions host process runs on net8.0 and loads DurableTask extension assemblies into its process. Packages like Microsoft.Extensions.*, Bcl.AsyncInterfaces, and System.Text.Json are part of the .NET shared framework - the host only provides version 8.0.0.0 of these assemblies. PR #510 upgraded these to 10.x, which causes FileNotFoundException at runtime: Could not load file or assembly 'Microsoft.Extensions.Options, Version=10.0.0.0' This reverts the 11 shared-framework packages to 8.x while keeping all other dependency upgrades (Grpc, Protobuf, Azure.Storage.Blobs, Azure.Identity, etc). Packages reverted: - Microsoft.Extensions.* (9 packages): 10.0.2 -> 8.x - Microsoft.Bcl.AsyncInterfaces: 10.0.2 -> 8.0.0 - System.Text.Json: 10.0.2 -> 8.0.5 Test project fix: - Generators.Tests: VersionOverride for DependencyInjection (net10 test project needs 10.x via Functions.Worker transitive dep, safe since tests don't load into the Functions host) global.json: relaxed SDK version to match installed 10.0.104
…compatibility The Azure Functions host process runs on net8.0 and loads DurableTask extension assemblies into its process. Packages like Microsoft.Extensions.*, Bcl.AsyncInterfaces, and System.Text.Json are part of the .NET shared framework - the host only provides version 8.0.0.0 of these assemblies. PR #510 upgraded these to 10.x, which causes FileNotFoundException at runtime: Could not load file or assembly 'Microsoft.Extensions.Options, Version=10.0.0.0' This reverts the 11 shared-framework packages to 8.x while keeping all other dependency upgrades (Grpc, Protobuf, Azure.Storage.Blobs, Azure.Identity, etc). Packages reverted: - Microsoft.Extensions.* (9 packages): 10.0.2 -> 8.x - Microsoft.Bcl.AsyncInterfaces: 10.0.2 -> 8.0.0 - System.Text.Json: 10.0.2 -> 8.0.5 Test project fix: - Generators.Tests: VersionOverride for DependencyInjection (net10 test project needs 10.x via Functions.Worker transitive dep, safe since tests don't load into the Functions host) global.json: relaxed SDK version to match installed 10.0.104
…compatibility The Azure Functions host process runs on net8.0 and loads DurableTask extension assemblies into its process. Packages like Microsoft.Extensions.*, Bcl.AsyncInterfaces, and System.Text.Json are part of the .NET shared framework - the host only provides version 8.0.0.0 of these assemblies. PR #510 upgraded these to 10.x, which causes FileNotFoundException at runtime: Could not load file or assembly 'Microsoft.Extensions.Options, Version=10.0.0.0' This reverts the 11 shared-framework packages to 8.x while keeping all other dependency upgrades (Grpc, Protobuf, Azure.Storage.Blobs, Azure.Identity, etc). Packages reverted: - Microsoft.Extensions.* (9 packages): 10.0.2 -> 8.x - Microsoft.Bcl.AsyncInterfaces: 10.0.2 -> 8.0.0 - System.Text.Json: 10.0.2 -> 8.0.5 Test project fix: - Generators.Tests: VersionOverride for DependencyInjection (net10 test project needs 10.x via Functions.Worker transitive dep, safe since tests don't load into the Functions host) global.json: relaxed SDK version to match installed 10.0.104
…compatibility The Azure Functions host process runs on net8.0 and loads DurableTask extension assemblies into its process. Packages like Microsoft.Extensions.*, Bcl.AsyncInterfaces, and System.Text.Json are part of the .NET shared framework - the host only provides version 8.0.0.0 of these assemblies. PR #510 upgraded these to 10.x, which causes FileNotFoundException at runtime: Could not load file or assembly 'Microsoft.Extensions.Options, Version=10.0.0.0' This reverts the 11 shared-framework packages to 8.x while keeping all other dependency upgrades (Grpc, Protobuf, Azure.Storage.Blobs, Azure.Identity, etc). Packages reverted: - Microsoft.Extensions.* (9 packages): 10.0.2 -> 8.x - Microsoft.Bcl.AsyncInterfaces: 10.0.2 -> 8.0.0 - System.Text.Json: 10.0.2 -> 8.0.5 Test project fix: - Generators.Tests: VersionOverride for DependencyInjection (net10 test project needs 10.x via Functions.Worker transitive dep, safe since tests don't load into the Functions host) global.json: relaxed SDK version to match installed 10.0.104
…compatibility The Azure Functions host process runs on net8.0 and loads DurableTask extension assemblies into its process. Packages like Microsoft.Extensions.*, Bcl.AsyncInterfaces, and System.Text.Json are part of the .NET shared framework - the host only provides version 8.0.0.0 of these assemblies. PR #510 upgraded these to 10.x, which causes FileNotFoundException at runtime: Could not load file or assembly 'Microsoft.Extensions.Options, Version=10.0.0.0' This reverts the 11 shared-framework packages to 8.x while keeping all other dependency upgrades (Grpc, Protobuf, Azure.Storage.Blobs, Azure.Identity, etc). Packages reverted: - Microsoft.Extensions.* (9 packages): 10.0.2 -> 8.x - Microsoft.Bcl.AsyncInterfaces: 10.0.2 -> 8.0.0 - System.Text.Json: 10.0.2 -> 8.0.5 Test project fix: - Generators.Tests: VersionOverride for DependencyInjection (net10 test project needs 10.x via Functions.Worker transitive dep, safe since tests don't load into the Functions host) global.json: relaxed SDK version to match installed 10.0.104
This pull request upgrades the project to support .NET 8.0 and .NET 10.0, modernizes dependencies across the codebase, and refactors the source generator for improved performance and maintainability. The most important changes are grouped below.
.NET Version Upgrades and Multi-Targeting
.github/workflows/validate-build.ymland set the default SDK to .NET 10.0 inglobal.json.Dependency Updates
Directory.Packages.propsto their latest releases compatible with .NET 8.0/10.0. This improves security, performance, and feature support.Build and Development Environment
Source Generator Refactor
DurableTaskSourceGeneratorto use the incremental generator API (IIncrementalGenerator), improving performance and reliability of code generation. The new implementation uses Roslyn incremental providers and removes the legacy syntax receiver pattern.General Code Modernization
System.Collections.Immutableimport in the generator for modern collection handling.