Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HybridCache serialization issues when in-memory #6063

Open
BrianVallelunga opened this issue Mar 10, 2025 · 0 comments
Open

HybridCache serialization issues when in-memory #6063

BrianVallelunga opened this issue Mar 10, 2025 · 0 comments
Labels
area-caching-hybrid bug This issue describes a behavior which is not expected - a bug. untriaged

Comments

@BrianVallelunga
Copy link

Description

I'm not sure if this is a bug or a misunderstanding, but when storing only locally, why is the data being serialized? I'd assume I could store any sort of object (interfaces, classes, etc) in a local, memory cache.

Reproduction Steps

My factory function returns a Task of an interface (IBloomFilter in this case). I'm passing the HybridCacheEntryFlags.DisableDistributedCache flag into the cache method as follows:

return hybridCache.GetOrCreate("BloomFilter", factory, HybridCacheEntryFlags.DisableDistributedCache)

Expected behavior

The object wouldn't go through serialization when caching locally in memory.

Actual behavior

An exception is thrown: System.NotSupportedException: Deserialization of interface or abstract types is not supported. Type 'BloomFilter.IBloomFilter'

Regression?

No response

Known Workarounds

No response

Configuration

.NET 9, HybridCache 9.2.0-preview1.25105.6

Other information

No response

@BrianVallelunga BrianVallelunga added bug This issue describes a behavior which is not expected - a bug. untriaged labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-caching-hybrid bug This issue describes a behavior which is not expected - a bug. untriaged
Projects
None yet
Development

No branches or pull requests

1 participant