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

Can not find the matched serializer instance, serializer name is redis1 #370

Closed
ysq5202121 opened this issue May 6, 2022 · 3 comments
Closed

Comments

@ysq5202121
Copy link

image

image

@catcherwong
Copy link
Member

@ysq5202121 Thanks for your interest in this project.

The default serializer's implementation of EasyCaching is BinaryFormatter, but after version .net 5 , it will no longer support, and we will remove it in next two release.

So we decided to upgrade for users to have a transitional period, let users adapt to the provider should specify the SerializerName.

Take a look on the following example.

option.UseRedis(config =>
{
    config.DBConfig.Endpoints.Add(new ServerEndPoint("127.0.0.1", 6379));
    
    // specify the SerializerName 
    config.SerializerName = "mymsgpack";
}, "redis1")

// using MessagePack to serialize caching data.
.WithMessagePack("mymsgpack");

@joer33304
Copy link

The online docs are outdated, It does not mention this at :https://easycaching.readthedocs.io/

@alam248
Copy link

alam248 commented Dec 27, 2022

I am facing this same issue. I upgraded solution from .Net Core 3.1 to .Net 6.

image

Following is my configuration:

var providerName = "EasyCacheProvider";
                services.AddEFSecondLevelCache(options =>
                {
                    options.UseEasyCachingCoreProvider(providerName, false).DisableLogging(false);
                });

                services.AddEasyCaching(options =>
                {
                    if (!appConfig.Caching.UseRedis)
                    {
                        options.UseInMemory(providerName);
                    }
                    else
                    {
                        options.UseRedis(config =>
                        {
                            config.DBConfig.Endpoints.Add(new ServerEndPoint(appConfig.Caching.RedisHost, appConfig.Caching.RedisPort));
                            config.DBConfig.Database = appConfig.Caching.Database;
                            config.SerializerName = providerName;
                        }, providerName).WithJson()
                        ;
                    }
                });

Following is my nuget situation:
image

Would be be great help if you guys can suggest me what should I do. I tried to change formatter name, I tried different versions of nuget packages. But keep getting same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants