Отключение Azure AppFabric Cache Asp.Net MVC - PullRequest
0 голосов
/ 12 мая 2018

Я работаю над обновлением веб-сайта, который был разработан еще в 2013 году. На веб-сайте Azure AppFabric используется для кэширования. Я размещал сайт на своем местном IIS. Когда я перехожу на сайт, я получаю следующую ошибку:

[SocketException (0x2af9): No such host is known]
   Microsoft.ApplicationServer.Caching.AsyncResultNoResult.EndInvoke() +84
   Microsoft.ApplicationServer.Caching.TcpClientChannelFactory.TcpConnectionCallback(IAsyncResult result) +126

[DataCacheException: ErrorCode<ERRCA0017>:SubStatus<ES0006>:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.). Additional Information : The client was trying to communicate with the server: net.tcp://mydomain.cache.windows.net:24233.]
   Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) +392
   Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1 servers, RequestBody request, Func`3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) +883
   Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket request, Func`2 delegate, EndpointID& destination) +49
   Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable`1 servers) +506
   Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate) +499
   Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler`1 fetchingHandler, EventHandler`1 fetchedHandler) +101
   Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateInternalProvider(IHttpRuntime httpRuntime, SessionInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler`1 cacheFetching, EventHandler`1 cacheFetched) +136
   Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetInternalProvider() +223
   Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateNewStoreData(HttpContext context, Int32 timeout) +19
   System.Web.SessionState.SessionStateModule.InitStateStoreItem(Boolean addToContext) +122
   System.Web.SessionState.SessionStateModule.CompleteAcquireState() +298
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1226
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128

В проект добавлены следующие пространства имен:

Microsoft.ApplicationServer.Caching.Core
Microsoft.ApplicationServer.Caching.Client
Microsoft.WindowsFabric.Common
Microsoft.WindowsFabric.Data.Common

важные детали Web.config:

<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />

<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="mydomain.cache.windows.net" />
            <!--<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="info" />
            </securityProperties>
        </dataCacheClient>
    </dataCacheClients>

<caching>
    <outputCache enableOutputCache="false" />
        <outputCacheSettings>
            <outputCacheProfiles>
                <add name="CacheName" duration="20" varyByParam="*"/>
            </outputCacheProfiles>
         </outputCacheSettings>
</caching>

Может кто-нибудь подсказать мне, как отключить кеш или есть способ локально эмулировать кеш AppFabric. Прошу прощения, если мой вопрос не ясен (так как это мой первый опыт использования служб Azure AppFabric.)

Заранее спасибо.

...