© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
Ben

❔ MemoryCache

Added
MemoryCache
MemoryCache
to my dotnet 6 app.
Works fine on windows, ubuntu suddenly throws -
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0

On library projects (that's referenced from the API) I need to install
Microsoft.Extensions.Caching.Memory
Microsoft.Extensions.Caching.Memory
in order to use
MemoryCache
MemoryCache
.
On the API itself I don't, is that cause of the additional Framework thats installed on the API project?

I've also checked earlier dotnet core versions, where I wasn't required to install this package, could that be a dotnet6 thing?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

AssemblyLoadContext not unloading if system.runtime.caching MemoryCache used inside ALC.
C#CC# / help
4y ago
✅ Best practice when using HttpClient in a class
C#CC# / help
3y ago
Implementing rate limiting for discord bot interactions with absolute expiration of items
C#CC# / help
3y ago
How the cache is stored
C#CC# / help
4y ago