0
votes

I want to use Azure Redis cache in my Android app and I need to add StackExchange.Redis nuget package first, according to the instructions here: https://azure.microsoft.com/en-us/documentation/articles/cache-dotnet-how-to-use-azure-redis-cache

However, when I do this, I get the following error message in package manager console:

Install failed. Rolling back... Install-Package : Could not install package 'StackExchange.Redis 1.0.488'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v4.4', but the packag e does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:16 + Install-Package <<<< StackExchange.Redis + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

What could be the reason for this? Is the nuget package I am trying to add noncompatible with MonoAndroid?

2

2 Answers

2
votes

StackExchange.Redis is based on full .NET 4.x. That means running the .NET code on Windows, you cannot run this component on Android. This component is intended to be used in your server side services (Web API, Azure Mobile App service, etc.) running in Azure or on-prem servers, but not really on your C# code in your client side (Android or iOS). Even StackExchange.Redis.Mono (https://www.nuget.org/packages/StackExchange.Redis.Mono/) is intended to be used from a Mac, not from Android/iOS. For a client side cache in a mobile app (Android), I'd recommend something like Akavache: https://github.com/akavache/Akavache

0
votes

UPDATE 2017

If someone looks this up, in the meantime, the StackExchange.Redis Package works under Xamarin Android using .NETStandard 1.5 profile. I didn't run many tests but was able to successfully install the package, connect to the locally running Service and perform basic commands.