MichaCo / CacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
http://cachemanager.michaco.net
Apache License 2.0
2.35k stars 456 forks source link

Basic problem with .NET Standard.... #288

Closed natiki closed 5 years ago

natiki commented 5 years ago

Hi,

I am following http://blog.chudinov.net/my-cache-interface-and-implementations/ but want to put this into a .NET Standard library. So I create a .NET Standard 2.0 class library:

image

and then took the code from https://github.com/mchudinov/CacheNet. But when I compile it I get the following error:

image

with the following package versions:

image

For the life of me I cannot figure out how to create the ICacheManagerConfiguration such that it reads the settings from web.config.

Can you please point me in the right direction?

MichaCo commented 5 years ago

I'm not the owner of that blog or github repo and the code samples, I guess you should ask there.

But anyways, the solution there uses the old csproj system and the full .NET framework. It also uses ConfigurationManager, and the old xml based configuration system. That doesn't exist in netstandard2.0.

CacheManager <=1.2.0 doesn't support that way of configuration with netstandard, that's why that overload in CacheFactory doesn't exist for you.

Support for that will come back in CacheManager 2.0 or so because MS added support back with the System.Configuration.ConfigurationManager nuget package.

natiki commented 5 years ago

Hi @MichaCo,

I appreciate you are not the owner of that blog just gave it for context....

  1. When do you think CM 2.0 will be RTM? I have been tracking https://github.com/MichaCo/CacheManager/issues/221
  2. Assuming a .NET Standard library that contains CM what is the "correct" way with CM 1.20 to load from a JSON configuration?