我正在尝试从Visual Studio Web项目连接到Azure Redis缓存(预览)的实例.
我收到以下错误:"无法加载文件或程序集'用户传递的授权令牌无效".
我已完成以下操作:1)登录Azure门户并创建新的Redis缓存预览 2)打开Visual Studio并创建新项目(Web MVC)3)管理Nuget包 - 全部更新4)安装包 - "Windows Azure缓存版本2.2.0.0"5)打开Web.Config,在dataCacheClients部分中执行以下操作:
6)将HomeController.cs更改为以下内容:
using Microsoft.ApplicationServer.Caching; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace CacheRedisTest.Controllers { public class HomeController : Controller { static DataCacheFactory myFactory; static DataCache myCache; public ActionResult Index() { if (myCache == null) { myFactory = new DataCacheFactory(); myCache = myFactory.GetDefaultCache(); } return View(); } } }
我是否需要一些特定于Redis的其他nuget包?另外,我在哪里放置Azure控制台中提到的端口号?
谢谢阅读