Skip to content

fix: revert shared framework packages to 8.x for net8 Functions host compatibility#698

Open
YunchuWang wants to merge 1 commit intomainfrom
wangbill/fix-net8-host-compat
Open

fix: revert shared framework packages to 8.x for net8 Functions host compatibility#698
YunchuWang wants to merge 1 commit intomainfrom
wangbill/fix-net8-host-compat

Conversation

@YunchuWang
Copy link
Copy Markdown
Member

@YunchuWang YunchuWang commented Apr 3, 2026

Problem

The Azure Functions host process runs on net8.0 (source) and loads DurableTask extension assemblies into its process. Packages like Microsoft.Extensions.*, Microsoft.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, causing FileNotFoundException at runtime when used as a Functions host extension:

\
Could not load file or assembly 'Microsoft.Extensions.Options, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
\\

Azure Functions 'supports .NET 10' only in the isolated worker process — the host process remains net8.

Fix

Revert 11 shared-framework packages to 8.x while keeping all other upgrades (Grpc, Protobuf, Azure.Storage.Blobs, Azure.Identity, CodeAnalysis, test frameworks):

Package Before After
Microsoft.Extensions.Caching.Memory 10.0.2 8.0.1
Microsoft.Extensions.Configuration.Abstractions 10.0.2 8.0.0
Microsoft.Extensions.DependencyInjection 10.0.2 8.0.1
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.2 8.0.2
Microsoft.Extensions.Hosting 10.0.2 8.0.1
Microsoft.Extensions.Hosting.Abstractions 10.0.2 8.0.1
Microsoft.Extensions.Logging.Abstractions 10.0.2 8.0.2
Microsoft.Extensions.Options 10.0.2 8.0.2
Microsoft.Extensions.Options.DataAnnotations 10.0.2 8.0.0
Microsoft.Bcl.AsyncInterfaces 10.0.2 8.0.0
System.Text.Json 10.0.2 8.0.5

Added IMPORTANT comment in Directory.Packages.props explaining why these must stay at 8.x.

Test fix

Generators.Tests.csproj (net10 test project) gets VersionOverride=\"10.0.2\" for Microsoft.Extensions.DependencyInjection since Microsoft.Azure.Functions.Worker 2.51.0 transitively needs 10.x. This is safe — test projects don't load into the Functions host.
t this change also adds a VersionOverride for Microsoft.Extensions.Hosting

Validation

  • dotnet build -c Release on full solution: 0 errors, 0 warnings

@YunchuWang YunchuWang force-pushed the wangbill/fix-net8-host-compat branch 3 times, most recently from e6e733f to e902278 Compare April 3, 2026 04:02
@YunchuWang YunchuWang marked this pull request as ready for review April 3, 2026 04:07
Copilot AI review requested due to automatic review settings April 3, 2026 04:07
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 aims to restore Azure Functions in-proc host (net8.0) compatibility by pinning shared-framework dependencies back to 8.x so the extension assemblies don’t require Microsoft.Extensions.* (and related) 10.x assembly versions that the host cannot load.

Changes:

  • Adds an IMPORTANT note in Directory.Packages.props explaining the Azure Functions host shared-framework constraint.
  • Reverts several centrally-managed shared-framework package versions (e.g., System.Text.Json, Microsoft.Bcl.AsyncInterfaces, various Microsoft.Extensions.*) back to 8.x.

Copilot AI review requested due to automatic review settings April 3, 2026 04: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

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

…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 YunchuWang force-pushed the wangbill/fix-net8-host-compat branch from c7f85e7 to 9cdd6df Compare April 3, 2026 04:25
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 2 out of 2 changed files in this pull request and generated 1 comment.

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.

3 participants