1

I am attempting a simple example project to get to know how to configure a Windows Azure Cloud service to use Co-located caching.

I am using VS2010 and have followed this example but when I get to the end of the section on co-located caching, I cannot run my project locally. It worked fine when

I am getting the following exceptions: (I hope it's readable..)

Error in '/' Application.

The requested name is valid, but no data of the requested type was found

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found] Microsoft.ApplicationServer.Caching.AsyncResultNoResult.EndInvoke() +202 Microsoft.ApplicationServer.Caching.AsyncResult`1.EndInvoke() +40 Microsoft.ApplicationServer.Caching.SocketConnectionFactory.EndConnect(IAsyncResult asyncResult) +75 Microsoft.ApplicationServer.Caching.TcpClientChannelFactory.TcpConnectionCallback(IAsyncResult result) +182

[DataCacheException: ErrorCode:SubStatus: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://SessionStateDemo:24233.] Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) +767 Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ResponseBody respBody, EndpointID destination) +149 Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable1 servers, RequestBody request, Func3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) +1313 Microsoft.ApplicationServer.Caching.<>c__DisplayClass5.b__2(RequestBody req) +198 Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendReceive(IVelocityRequestPacket request, Func2 delegate, EndpointID& destination) +121 Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable1 servers) +1225 Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate) +1104 Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName) +131 Microsoft.Web.DistributedCache.DataCacheFactoryWrapper.CreateDataCacheFromFactory(DataCacheFactory factory, String cacheName) +63 Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler1 fetchingHandler, EventHandler1 fetchedHandler) +306 Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateInternalProvider(IHttpRuntime httpRuntime, SessionInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler1 cacheFetching, EventHandler1 cacheFetched) +399 Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetInternalProvider() +315 Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateNewStoreData(HttpContext context, Int32 timeout) +59 System.Web.SessionState.SessionStateModule.InitStateStoreItem(Boolean addToContext) +160 System.Web.SessionState.SessionStateModule.CompleteAcquireState() +340 System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1269 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +12698078 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

Can anyone tell me what is happening here? How can I fix this?

Is there something missing in that tutorial that I need to do?

EDIT: I am using VS2010 Professional, with Windows Azure SDK 2.1. Widnows Azure Cache package is v2.1.0.

Relevant web.config sections:

<system.web>
...
<!-- Windows Azure Caching session state provider -->
    <sessionState mode="Custom" customProvider="AFCacheSessionStateProvider">
      <providers>
        <add name="AFCacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" applicationName="AFCacheSessionState"/>
      </providers>
    </sessionState>
...
<sytem.web>

    <dataCacheClients>
    <dataCacheClient name="default">
      <!--To use the in-role flavor of Windows Azure Caching, set identifier to be the cache cluster role name -->
      <autoDiscover isEnabled="true" identifier="SessionStateDemo" />
    </dataCacheClient>
  </dataCacheClients>
8
  • Which versions of Windows Azure SDK and Windows Azure Cache do you use? Commented Sep 22, 2014 at 14:01
  • Azure SDK is v2.1, Windows Azure Cache version is 2.4. Commented Sep 22, 2014 at 14:19
  • It looks like you need Windows Azure SDK version 2.4, the similar issue here. Commented Sep 22, 2014 at 14:22
  • 2.1 is the latest SDK version that supports Visual Studio 2010... Would it work better if I installed Azure Cache 2.1 to match? Or do these versions have to match? Commented Sep 22, 2014 at 14:27
  • From the Azure Cache nuget package description, they have to match. If v.2.1 is the latest SDK for VS2010 I'd suggest to use Windows Azure Cache v.2.1. Commented Sep 22, 2014 at 14:29

1 Answer 1

0

Based on this thread it looks like the Windows Azure Cloud Service must be a startup project to work properly. Otherwise the Windows Azure Runtime won't initialize what causes the SocketExceptions.

Sign up to request clarification or add additional context in comments.

1 Comment

HI Teddy, I have the Cloud Service as the startup project and am still getting the exception.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.