Skip to content

HybridCache: MissingMethodException (HybridCacheEntryOptions.ToDistributedCacheEntryOptions) on .NET 11 preview — no net11-aligned Microsoft.Extensions.Caching.Hybrid published #130376

Description

@gkizior

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

On .NET 11 preview (SDK 11.0.100-preview.5.26302.115), any HybridCache write that reaches the L2 (distributed) cache throws MissingMethodException for HybridCacheEntryOptions.ToDistributedCacheEntryOptions, logged by the framework as "Cache backend write failure."

HybridCacheEntryOptions ships in the Microsoft.Extensions.Caching.Abstractions assembly (part of the .NET 11 shared framework). The Microsoft.Extensions.Caching.Hybrid implementation package (latest 10.7.0) — DefaultHybridCache — calls HybridCacheEntryOptions.ToDistributedCacheEntryOptions on its L2 write path. On net11 the framework's HybridCacheEntryOptions no longer exposes that member (binary-breaking), so the 10.x impl fails at runtime.

There is no net11-aligned Microsoft.Extensions.Caching.Hybrid available: nuget.org tops out at 10.7.0, and the dnceng/public dotnet-public, dotnet10, and dotnet11 feeds have no 11.0.0-preview.* for this package. So there is currently no way to use HybridCache with an L2 cache on .NET 11.

Expected Behavior

HybridCache writes to an L2 IDistributedCache succeed on .NET 11 (a net11-aligned Hybrid package is published, or the abstraction change is made non-breaking).

Steps To Reproduce

Target net11.0, reference Microsoft.Extensions.Caching.Hybrid 10.6.0 or 10.7.0:

var services = new ServiceCollection();
services.AddDistributedMemoryCache();     // any IDistributedCache => HybridCache uses it as L2
services.AddHybridCache();
var sp = services.BuildServiceProvider();
var cache = sp.GetRequiredService<HybridCache>();

// Writes L1 then background-writes L2 -> throws
await cache.GetOrCreateAsync("key", _ => ValueTask.FromResult(42));

Exceptions (if any)

System.MissingMethodException: Method not found: 'Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.ToDistributedCacheEntryOptions'.
at Microsoft.Extensions.Caching.Hybrid.Internal.DefaultHybridCache.g__ToDistributedCacheEntryOptions|57_0(HybridCacheEntryOptions options)
at Microsoft.Extensions.Caching.Hybrid.Internal.DefaultHybridCache.GetL2DistributedCacheOptions(HybridCacheEntryOptions options)
at Microsoft.Extensions.Caching.Hybrid.Internal.DefaultHybridCache.WritePayloadAsync(String key, CacheItem cacheItem, BufferChunk payload, HybridCacheEntryOptions options, CancellationToken token)
at Microsoft.Extensions.Caching.Hybrid.Internal.DefaultHybridCache.StampedeState`2.BackgroundFetchAsync()

.NET Version

11.0.100-preview.5.26302.115

Anything else?

  • Package versions tried: Microsoft.Extensions.Caching.Hybrid 10.6.0 and 10.7.0 — both fail identically.
  • Impact: L1 (in-memory) cache still works; only L2/distributed writes fail — so it's non-fatal but disables distributed HybridCache on net11.
  • Feeds checked for a net11 build (none found): nuget.org, dnceng/public/dotnet-public, .../dotnet10, .../dotnet11.
  • Root cause appears to be a binary-breaking change to HybridCacheEntryOptions in the net11 Microsoft.Extensions.Caching.Abstractions without a correspondingly-rebuilt Microsoft.Extensions.Caching.Hybrid.

Activity

  1. added theissue type on Jul 8, 2026
  2. BrennanConroy commented on Jul 8, 2026

    @BrennanConroy
    Member

    Issue belongs in either dotnet/extensions for the Caching.Hybrid part, or dotnet/runtime for the Caching.Abstractions part.

  3. gkizior commented on Jul 8, 2026

    @gkizior
    Author

    Issue belongs in either dotnet/extensions for the Caching.Hybrid part, or dotnet/runtime for the Caching.Abstractions part.

    Thank you @BrennanConroy. Can you please transfer the issue?

  4. added
    untriaged
    on Jul 8, 2026
  5. dotnet-policy-service commented on Jul 8, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-extensions-caching
    See info in area-owners.md if you want to be subscribed.

  6. cincuranet commented on Jul 9, 2026

    @cincuranet
    Contributor
  7. self-assigned this
    on Jul 9, 2026
  8. svick commented on Jul 9, 2026

    @svick
    Member

    Thanks for the report.

    This is not a version mismatch issue (i.e. Microsoft.Extensions.Caching 11.0 would have the same problem, if it existed), it's a regular bug. The ToDistributedCacheEntryOptions() method was always internal and MS.E.Caching.Hybrid effectively accessed it through reflection. What changed is that the MS.E.Caching.Abstractions assembly is now trimmed, so ToDistributedCacheEntryOptions() was removed.

    I have opened #130403 that should fix this (though the fix won't make it into .Net 11 Preview 6).

  9. added this to the 11.0.0 milestone on Jul 9, 2026
  10. added
    in-pr
    on Jul 9, 2026
  11. removed
    untriaged
    on Jul 9, 2026
  12. removed
    in-pr
    on Jul 17, 2026
  13. locked and limited conversation to collaborators on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions