我正在开发一个网站项目(转换为 Web 角色)以使用角色内 Windows Azure 缓存。一切都完美无缺,但在我启用缓存的那一刻,应用程序崩溃,在 IIS 日志或事件查看器中显然没有有用的消息。我得到的只是——
事件代码:3005 事件消息:发生未处理的异常。事件时间:21/09/2013 23:59:39 事件时间 (UTC):21/09/2013 22:59:39 事件 ID:440c14c6c5f848b683cf33b2a553b42c 事件顺序:3 事件发生:1 事件详细代码:0
异常信息:异常类型:SocketException 异常消息:在 Microsoft.ApplicationServer.Caching.SocketConnectionFactory 的 Microsoft.ApplicationServer.Caching.AsyncResult`1.EndInvoke() 的 Microsoft.ApplicationServer.Caching.AsyncResultNoResult.EndInvoke() 中不知道此类主机。 EndConnect(IAsyncResult asyncResult) 在 Microsoft.ApplicationServer.Caching.TcpClientChannelFactory.TcpConnectionCallback(IAsyncResult 结果)
我已经有了 Windows Azure SDK 2.1 和 Windows Azure Caching 2.1 版本。我尝试了此处建议的解决方案无济于事-
我在服务配置中有 2 个具有以下设置的 Web 角色实例 -
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel" value="4" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel" value="4" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="30" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="UseDevelopmentStorage=true" />
以及 web 角色的 web.config 中的以下条目
<sessionState mode="Custom" customProvider="defaultProvider" cookieless="UseCookies">
<providers>
<add cacheName="default" name="defaultProvider" dataCacheClientName="default" applicationName="TravelEagle" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" />
</providers>
</sessionState>
<dataCacheClients>
<dataCacheClient name="default">
<autoDiscover isEnabled="true" identifier="TravelEagle" />
</dataCacheClient>
</dataCacheClients>
<cacheDiagnostics>
<crashDump dumpLevel="Off" dumpStorageQuotaInMB="100" />
</cacheDiagnostics>
如果我尝试使用 Azure 模拟器运行应用程序,我会收到另一个错误:
为应用程序池“5e45b35f-ccd3-485e-8f12-b70178ffd1a3”提供服务的进程意外终止。进程 ID 为“11096”。进程退出代码是“0xffffffffe”。
和
{0} 未能刷新查找表,异常:{Microsoft.Fabric.Common.OperationCompletedException:操作完成但出现异常 ---> Microsoft.Fabric.Federation.RoutingException:目标节点显式中止操作 --- End of inner异常堆栈跟踪 --- 在 Microsoft.Fabric.Common.OperationContext.End() 在 Microsoft.Fabric.Federation.FederationSite.EndRoutedSendReceive(IAsyncResult ar) 在 Microsoft.Fabric.Data.ReliableServiceManager.EndRefreshLookupTable(IAsyncResult ar)}
任何帮助将不胜感激。