Skip to content

Update project to target .NET 8.0 and .NET 10 and upgrade dependencies#510

Merged
torosent merged 10 commits intomainfrom
torosent/update-net8
Nov 22, 2025
Merged

Update project to target .NET 8.0 and .NET 10 and upgrade dependencies#510
torosent merged 10 commits intomainfrom
torosent/update-net8

Conversation

@torosent
Copy link
Copy Markdown
Member

@torosent torosent commented Nov 21, 2025

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

  • Updated build and workflow configuration to use .NET 8.0 in .github/workflows/validate-build.yml and set the default SDK to .NET 10.0 in global.json.
  • Changed project files for all samples and main libraries to target multiple frameworks, including net6.0, net8.0, and net10.0 where appropriate. This ensures compatibility and future-proofs the codebase.

Dependency Updates

  • Upgraded package versions for Microsoft.Extensions., Azure., Grpc., Microsoft.CodeAnalysis., and other libraries in Directory.Packages.props to their latest releases compatible with .NET 8.0/10.0. This improves security, performance, and feature support.
  • Updated testing and analysis dependencies (e.g., BenchmarkDotNet, xunit, FluentAssertions) to latest versions for improved reliability and compatibility.

Build and Development Environment

  • Updated VS Code task configuration to use the net8.0 output directory for Azure Functions, aligning with the new target frameworks.

Source Generator Refactor

  • Refactored DurableTaskSourceGenerator to 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

  • Added System.Collections.Immutable import in the generator for modern collection handling.

Copilot AI review requested due to automatic review settings November 21, 2025 21:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.0 to net8.0, with multi-targeted projects now including net8.0 alongside netstandard2.0 and net48
  • Upgraded dependencies to .NET 8-compatible versions including Microsoft.Extensions., Azure., Grpc, and testing packages
  • Migrated source generator from ISourceGenerator to IIncrementalGenerator API 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


<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks>
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 21, 2025

@torosent I've opened a new pull request, #511, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 21, 2025 21:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated no new comments.

Copilot AI and others added 3 commits November 21, 2025 13:23
* 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>
Copilot AI review requested due to automatic review settings November 21, 2025 21:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated no new comments.

@halspang
Copy link
Copy Markdown
Member

@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?

@jviau
Copy link
Copy Markdown
Member

jviau commented Nov 21, 2025

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 netstandard2.0 as well, net6.0 customers won't outright fail restore. They will be silently shifted to netstandard2.0 and their entire transitive dependency graph as well as a result. This can be very harmful to those customers. Especially the change in Grpc dependencies: these customers will be moved from Grpc.Net.Client to Grpc.Core, which is unsupported and a much worse option that Grpc.Net.Client.

There are a couple options to supporting net8.0:

  1. Do not remove net6.0. Just add net8.0 in addition to net6.0 (might as well add net10.0 while you are at it)
    • this is by far the easiest and least disruptive option.
    • net6.0 can then be removed in a major version rev.
  2. Remove net6.0 but add targets to explicit break the customers build, telling them net6.0 is out of support and cannot be used with these packages anymore.
    • This is fairly disruptive. Will also need to block net7.0 as well. Dotnet BCL libraries started in net10 (or is it net9?) include targets that warn when you use them in out of support TFMs. I would go with an error though here as it is more impactful than the dotnet BCL case, they are just warning it isn't tested. In our case it is an outright massive behavior change / break, but one that can manifest only at runtime. Failing at build time would be much preferred.

Regardless of the choice made, I recommend also adding net10.0 as it is LTS. I would then condition the packages in Directory.Packages.props to be 8.x or 10.x based on the TFM. If you do keep net6.0, I think it is acceptable to still bump all net6.0 dependencies to 8.x. So you would have: netstandard2.0, net6.0, net8.0 --> 8.x dependencies. net10.0 --> 10.x dependencies.

Copilot AI review requested due to automatic review settings November 21, 2025 23:30
@torosent torosent changed the title Update project to target .NET 8.0 and upgrade dependencies Update project to target .NET 8.0 and .NET 10 and upgrade dependencies Nov 21, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated no new comments.

@torosent
Copy link
Copy Markdown
Member Author

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 netstandard2.0 as well, net6.0 customers won't outright fail restore. They will be silently shifted to netstandard2.0 and their entire transitive dependency graph as well as a result. This can be very harmful to those customers. Especially the change in Grpc dependencies: these customers will be moved from Grpc.Net.Client to Grpc.Core, which is unsupported and a much worse option that Grpc.Net.Client.

There are a couple options to supporting net8.0:

  1. Do not remove net6.0. Just add net8.0 in addition to net6.0 (might as well add net10.0 while you are at it)

    • this is by far the easiest and least disruptive option.
    • net6.0 can then be removed in a major version rev.
  2. Remove net6.0 but add targets to explicit break the customers build, telling them net6.0 is out of support and cannot be used with these packages anymore.

    • This is fairly disruptive. Will also need to block net7.0 as well. Dotnet BCL libraries started in net10 (or is it net9?) include targets that warn when you use them in out of support TFMs. I would go with an error though here as it is more impactful than the dotnet BCL case, they are just warning it isn't tested. In our case it is an outright massive behavior change / break, but one that can manifest only at runtime. Failing at build time would be much preferred.

Regardless of the choice made, I recommend also adding net10.0 as it is LTS. I would then condition the packages in Directory.Packages.props to be 8.x or 10.x based on the TFM. If you do keep net6.0, I think it is acceptable to still bump all net6.0 dependencies to 8.x. So you would have: netstandard2.0, net6.0, net8.0 --> 8.x dependencies. net10.0 --> 10.x dependencies.

Thanks Jacob. I updated to support 6.0, 8.0 and 10.0

Copy link
Copy Markdown
Member

@halspang halspang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments/questions. Overall looks good!

@torosent torosent merged commit 095253f into main Nov 22, 2025
4 checks passed
@torosent torosent deleted the torosent/update-net8 branch November 22, 2025 00:35
YunchuWang added a commit that referenced this pull request Apr 3, 2026
…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
YunchuWang added a commit that referenced this pull request Apr 3, 2026
…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
YunchuWang added a commit that referenced this pull request Apr 3, 2026
…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
YunchuWang added a commit that referenced this pull request Apr 3, 2026
…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
YunchuWang added a commit that referenced this pull request Apr 3, 2026
…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
YunchuWang added a commit that referenced this pull request Apr 3, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants