在 Xamarin Android 应用程序中使用 Azure Redis 缓存
Using Azure Redis cache in Xamarin Android apps
我想在我的 Android 应用程序中使用 Azure Redis 缓存,我需要添加 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
但是,当我这样做时,我在程序包管理器控制台中收到以下错误消息:
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
这可能是什么原因?我要添加的 nuget 包是否与 MonoAndroid 不兼容?
StackExchange.Redis 基于完整的 .NET 4.x。这意味着 运行 在 Windows 上使用 .NET 代码,你不能 运行 在 Android 上使用此组件。此组件旨在用于您的服务器端服务(Web API、Azure 移动应用程序服务等)运行 在 Azure 或本地服务器中,但实际上不是在您的 C# 代码中您的客户端(Android 或 iOS)。
甚至 StackExchange.Redis.Mono (https://www.nuget.org/packages/StackExchange.Redis.Mono/) 也旨在从 Mac 中使用,而不是从 Android/iOS 中使用。
对于移动应用程序 (Android) 中的客户端缓存,我推荐类似 Akavache 的东西:https://github.com/akavache/Akavache
2017 年更新
如果有人查过这个,与此同时,StackExchange.Redis 包在 Xamarin Android 下使用 .NETStandard 1.5 配置文件工作。我没有 运行 多次测试,但能够成功安装包、连接到本地 运行ning 服务并执行基本命令。
我想在我的 Android 应用程序中使用 Azure Redis 缓存,我需要添加 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
但是,当我这样做时,我在程序包管理器控制台中收到以下错误消息:
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
这可能是什么原因?我要添加的 nuget 包是否与 MonoAndroid 不兼容?
StackExchange.Redis 基于完整的 .NET 4.x。这意味着 运行 在 Windows 上使用 .NET 代码,你不能 运行 在 Android 上使用此组件。此组件旨在用于您的服务器端服务(Web API、Azure 移动应用程序服务等)运行 在 Azure 或本地服务器中,但实际上不是在您的 C# 代码中您的客户端(Android 或 iOS)。 甚至 StackExchange.Redis.Mono (https://www.nuget.org/packages/StackExchange.Redis.Mono/) 也旨在从 Mac 中使用,而不是从 Android/iOS 中使用。 对于移动应用程序 (Android) 中的客户端缓存,我推荐类似 Akavache 的东西:https://github.com/akavache/Akavache
2017 年更新
如果有人查过这个,与此同时,StackExchange.Redis 包在 Xamarin Android 下使用 .NETStandard 1.5 配置文件工作。我没有 运行 多次测试,但能够成功安装包、连接到本地 运行ning 服务并执行基本命令。