thepirat000 / CachingFramework.Redis

Distributed caching based on StackExchange.Redis and Redis. Includes support for tagging and is cluster-compatible.
Other
289 stars 52 forks source link

Is Cachingframework.Redis is not compatible with .net core v2.0? #42

Closed PrachiChoudhary closed 6 years ago

PrachiChoudhary commented 6 years ago

While referring Cachingframework.Redis in lambda function getting following error. Please suggest whether it is not compatible. Do I need to chose any other version or any other library?

... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : warning NU1701: Package 'CachingFramework.Redis 5.1.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project. ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: Detected package downgrade: System.IO.FileSystem from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version. ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.Net.Sockets 4.1.0 -> runtime.unix.System.Net.Sockets 4.3.0 -> System.IO.FileSystem (>= 4.3.0) ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.IO.FileSystem (>= 4.0.1) ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: Detected package downgrade: System.Net.NameResolution from 4.3.0 to 4.0.0. Reference the package directly from the project to select a different version. ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.Net.Sockets 4.1.0 -> runtime.unix.System.Net.Sockets 4.3.0 -> System.Net.NameResolution (>= 4.3.0) ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.Net.NameResolution (>= 4.0.0) ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: Detected package downgrade: System.Net.Primitives from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version. ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.Net.Sockets 4.1.0 -> runtime.unix.System.Net.Sockets 4.3.0 -> System.Net.Primitives (>= 4.3.0) ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.Net.Sockets 4.1.0 -> System.Net.Primitives (>= 4.0.11) ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: Detected package downgrade: System.Threading.ThreadPool from 4.3.0 to 4.0.10. Reference the package directly from the project to select a different version. ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.Net.Sockets 4.1.0 -> runtime.unix.System.Net.Sockets 4.3.0 -> System.Threading.ThreadPool (>= 4.3.0) ... publish: D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj : error NU1605: AWSLambda1 -> CachingFramework.Redis 5.1.0 -> StackExchange.Redis 1.1.608 -> System.Threading.ThreadPool (>= 4.0.10) ... publish: Restore failed in 575.54 ms for D:\Dev\KinesisConsumer\data-in-trans\AWSLambda1\AWSLambda1.csproj.

thepirat000 commented 6 years ago

oh.. wait, you are restoring an old version CachingFramework.Redis (5.1.0), that one is not compatible with NetStandard. Upgrade to the latest version of the library: https://www.nuget.org/packages/CachingFramework.Redis/7.5.0

PrachiChoudhary commented 6 years ago

Hi it seems that it is not working with CachingFramework.Redis 7.5.0 also. We got same type of error. We are using Visual Studio 2017, can this be the issue? Please guide us

thepirat000 commented 6 years ago

Can you provide, at least, the code that is failing and the error you're getting with 7.5.0? Also can you share the non-sensitive content of your AWSLambda1.csproj?

PrachiChoudhary commented 6 years ago

Hi There is no code as such in my AWSLambda1.csproj. I just chose the empty function and included your library. It succeeded the build but when I tried to upload it to AWS Lambda got following error.

image Thanks

thepirat000 commented 6 years ago

oh.. I see... I think the problem is that AWS publishing command is treating the NU1605 warning as an error. But that warning seems to be triggered by the StackExchange.Redis library references.

Can you try adding the following to your csproj?

<PropertyGroup>
    <NoWarn>NU1605</NoWarn>
</PropertyGroup>

Also found this: https://github.com/aws/aws-lambda-dotnet/issues/164

thepirat000 commented 6 years ago

I've published a new version of the library with explicit net standard 2 targeting, and updated the StackExchange.Redis library reference to the latest. Maybe that solves your issue.

Please re-test with the new version 8.0.0

PrachiChoudhary commented 6 years ago

Thanks a lot. It worked with new version 8.0.0.

mohsina-virtus commented 6 years ago

hello sir, please help I am getting the following message when trying to install through nuget {Could not install package 'CachingFramework.Redis 10.0.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.}

thepirat000 commented 6 years ago

hi. The library is not compatible with .Net framework 4.0

the latest version is compatible with .Net framework >= 4.6.1 and .Net Core >= 2.0

Get Outlook for Androidhttps://aka.ms/ghei36


From: Mohsinahabeeba notifications@github.com Sent: Saturday, October 6, 2018 1:16:29 AM To: thepirat000/CachingFramework.Redis Cc: Federico Daniel Colombo; State change Subject: Re: [thepirat000/CachingFramework.Redis] Is Cachingframework.Redis is not compatible with .net core v2.0? (#42)

hello sir, please hellp I am getting the following message when trying to in stall through nuget {Could not install package 'CachingFramework.Redis 10.0.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.}

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/thepirat000/CachingFramework.Redis/issues/42#issuecomment-427549861, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJYXXFP6VJa5pJHRDveWPIQbrsiO4mcNks5uiEq9gaJpZM4UGow0.

mohsina-virtus commented 6 years ago

thanks, changing the .Net framework version to 4.6.1 worked for me :+1: