1

我正在为 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 服务。)

提前致谢。

4

0 回答 0