You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HybridCache: MissingMethodException (HybridCacheEntryOptions.ToDistributedCacheEntryOptions) on .NET 11 preview — no net11-aligned Microsoft.Extensions.Caching.Hybrid published #130376
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:
varservices=newServiceCollection();services.AddDistributedMemoryCache();// any IDistributedCache => HybridCache uses it as L2services.AddHybridCache();varsp=services.BuildServiceProvider();varcache=sp.GetRequiredService<HybridCache>();// Writes L1 then background-writes L2 -> throwsawaitcache.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.
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).
Activity
BrennanConroy commentedon Jul 8, 2026
Issue belongs in either dotnet/extensions for the Caching.Hybrid part, or dotnet/runtime for the Caching.Abstractions part.
gkizior commentedon Jul 8, 2026
Thank you @BrennanConroy. Can you please transfer the issue?
dotnet-policy-service commentedon Jul 8, 2026
Tagging subscribers to this area: @dotnet/area-extensions-caching
See info in area-owners.md if you want to be subscribed.
cincuranet commentedon Jul 9, 2026
cc @svick
svick commentedon Jul 9, 2026
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 alwaysinternaland MS.E.Caching.Hybrid effectively accessed it through reflection. What changed is that the MS.E.Caching.Abstractions assembly is now trimmed, soToDistributedCacheEntryOptions()was removed.I have opened #130403 that should fix this (though the fix won't make it into .Net 11 Preview 6).
Remove ineffective ILLink.Descriptors.LibraryBuild.xml
Preserve HybridCacheEntryOptions.ToDistributedCacheEntryOptions from …