所以我得到了很多用户经历过的相同错误 -

> Home Page. Modify this template to jump-start your ASP.NET MVC
> application.Microsoft.ApplicationServer.Caching.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://hamzacachetrial.cache.windows.net:24233. at
> Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus
> errStatus, Guid trackingId, Exception responseException, Byte[][]
> payload, EndpointID destination) at
> Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody
> respBody, EndpointID destination) at
> Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable`1
> servers, RequestBody request, Func`3 sendMessageDelegate,
> DataCacheReadyRetryPolicy retryPolicy) at
> Microsoft.ApplicationServer.Caching.SocketClientProtocol.<>c__DisplayClass5.<Initialize>b__2(RequestBody
> req) at
> Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket
> request, Func`2 delegate, EndpointID& destination) at
> Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable`1
> servers) at
> Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String
> cacheName, CreateNewCacheDelegate cacheCreationDelegate,
> DataCacheInitializationViaCopyDelegate initializeDelegate) at
> Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String
> cacheName) at MvcWebRole1.Controllers.HomeController.Index() in
> c:\Users\hk7654\Documents\Visual Studio
> 2012\Projects\CacheTrial\MvcWebRole1\Controllers\HomeController.cs:line
> 46

这是我的功能 -

`public ActionResult Index()
    {
        var retryStrategy = new FixedInterval(5, TimeSpan.FromSeconds(60));
        var retryPolicy = new RetryPolicy<CacheTransientErrorDetectionStrategy>(retryStrategy);
        DataCache cache = null;

        retryPolicy.Retrying += (sender1, args) =>
        {
            var msg = String.Format("Retry - Count:{0}, Delay:{1}, Exception:{2}",
                args.CurrentRetryCount, args.Delay, args.LastException);
            Trace.Write(msg);
        };

        try
        {
             DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration();
             config.TransportProperties.ReceiveTimeout = new TimeSpan(45000);
             config.ChannelOpenTimeout = new TimeSpan(150000);

             DataCacheFactory cacheFactory = new DataCacheFactory(config);
             cache = cacheFactory.GetCache("default");

             retryPolicy.ExecuteAction(
             () =>
                {
                    cache.Add("name" + _i++, "hamza");

                });

         }
         catch (DataCacheException ex)
         {
              Trace.Write(ex.GetType().ToString() +  ex.Message.ToString()+ex.StackTrace.ToString());
         }

    }`

我已经使用了Transient Fault Handling以及一些解决方案中提到的ChannelOpenTimeout和TransportProperties.ReceiveTimeout . 这是Web配置的datacacheclient部分 -

<dataCacheClients>
<dataCacheClient name="default">

  <autoDiscover isEnabled="true" identifier="hamzacachetrial.cache.windows.net" />
  <securityProperties mode="Message" sslEnabled="false">
    <messageSecurity authorizationInfo="XXXXXXXXXX" />
  </securityProperties>
</dataCacheClient>

这里似乎没有任何错误 .

当我使用角色内缓存时,我没有遇到这样的问题,但专用缓存服务不起作用 . 缓存是标准4GB缓存我也尝试过基本的128 MB缓存 . 我需要知道的另一件事是必须使用ClientPerfCounters吗?他们不应该只是为了确定 . 我知道很多人都问过这个,但没有一个解决方案对我有用 . 请帮忙!!!