Windows Azure Caching не создается в консольном базовом приложении.
У меня возникла проблема при попытке запустить DataCache в моей консоли / веб-приложении. После длительного времени исключение показано на рисунке ниже. Я перепробовал все способы, используя DataCacheFactory и простой DataCache, но возникает та же проблема. Пожалуйста, помогите мне в этом вопросе! Введите описание изображения здесь
2 ответа
Сбой после долгого времени указывает в основном на проблему с сетью. Проверьте это, увидев, что конечная точка, к которой вы пытаетесь подключиться, недоступна, или DNS разрешается правильно и т. Д.
Вы утилизируете базу данных? Конечной точкой должна быть вся информация, предоставленная порталом кэша: yourchosencahcename.cache.windows.net
Кажется, что забыли настроить файл.config. Вы устанавливали через Nuget? Вы должны настроить свой app.config, вы должны установить "[Имя роли кэша или конечную точку службы]":
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<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" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<dataCacheClients>
<dataCacheClient name="default">
<!--To use the in-role flavor of Windows Azure Cache, set identifier to be the cache cluster role name -->
<!--To use the Windows Azure Cache Service, set identifier to be the endpoint of the cache cluster -->
<autoDiscover isEnabled="true" identifier="[Cache role name or Service Endpoint]" />
<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>
</dataCacheClients>