【发布时间】:2013-08-04 16:55:05
【问题描述】:
让共享缓存正常工作我完全不知所措。
在本地,我正在运行一个 mvc4 站点,并由此创建了一个云项目。我在角色上启用了缓存并将其设置为共同定位。到目前为止一切都很好。
我从 NuGet 添加了 Windows Azure Caching 2.1 包,它安装了相关库并更新了我的 Web 配置:
configSections:
<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
<section name="cacheDiagnostics" type="Microsoft.ApplicationServer.Caching.AzureCommon.DiagnosticsConfigurationSection, Microsoft.ApplicationServer.Caching.AzureCommon" allowLocation="true" allowDefinition="Everywhere" />
配置:
<dataCacheClients>
<dataCacheClient name="default">
<!--To use the in-role flavor of Windows Azure Caching, set identifier to be the cache cluster role name -->
<!--To use the Windows Azure Caching Service, set identifier to be the endpoint of the cache cluster -->
<autoDiscover isEnabled="true" identifier="" />
<!--<localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />-->
<!--Use this section to specify security settings for connecting to your cache. This section is not required if your cache is hosted on a role that is a part of your cloud service. -->
<!--<securityProperties mode="Message" sslEnabled="false">
<messageSecurity authorizationInfo="[Authentication Key]" />
</securityProperties>-->
</dataCacheClient>
当我按照说明将角色名称添加到 autoDiscover 元素上的 identifer 属性并运行应用程序时,它似乎只是挂起(我假设失败):
_cache = new DataCache("default");
我正在运行存储模拟器并从计算模拟器进行站点调试。我似乎无法将站点配置为使用 azure 缓存。
【问题讨论】:
标签: c# azure shared-cache