首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法连接到azure redis缓存

无法连接到azure redis缓存
EN

Stack Overflow用户
提问于 2016-07-05 03:01:26
回答 0查看 896关注 0票数 4

我无法连接到Azure Redis缓存。我得到了一个异常:在StackExchange.Redis.dll中发生了'System.NullReferenceException‘类型的异常,但在用户代码中没有被处理。我现在有点困惑。我是否仍然可以使用发布/订阅功能,该功能在连接到本地主机时可用,或者azure redis缓存仅用于存储?我使用调试器并检查多路复用器的isConnected属性,isConnected属性为false。

代码语言:javascript
复制
    static ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(ConfigurationManager.ConnectionStrings["Redis"].ToString());
    IDatabase cache = redis.GetDatabase();

            // Perform cache operations using the cache object...
            // Simple put of integral data types into the cache
            cache.StringSet("key1", "value");
            cache.StringSet("key2", 25);

            ISubscriber sub = redis.GetSubscriber();
            const string channelName = "Transactions";
            const string transTblName = "Transaction";
            sub.Publish(channelName, transJson);
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38190842

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档