最近我的主计算机的 Window Azure 模拟器开始出现问题。当我尝试使用模拟器调试我的解决方案时,它最终会循环尝试连接。
这是我在输出窗口中得到的内容:
> iisexpress.exe Warning: 0 : WARNING: <SimpleSendReceiveModule> d8c9fa85-ded3-48ad-94a3-ec31e2123bb3:Request - 1, result - Status=ChannelOpenFailed[System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.255.0.0:20004
at Microsoft.ApplicationServer.Caching.AsyncResultNoResult.EndInvoke()
at Microsoft.ApplicationServer.Caching.AsyncResult`1.EndInvoke()
at Microsoft.ApplicationServer.Caching.TcpClientChannelFactory.EndConnect(IAsyncResult asyncResult)
at
Microsoft.ApplicationServer.Caching.TcpClientChannel.ConnectionCallback(IAsyncResult result)] for end point [net.tcp://127.255.0.0:20004]
Microsoft.WindowsAzure.ServiceRuntime Verbose: 500 : Role instance status check starting
Microsoft.WindowsAzure.ServiceRuntime Verbose: 502 : Role instance status check succeeded: Ready
Microsoft.WindowsAzure.ServiceRuntime Verbose: 500 : Role instance status check starting
Microsoft.WindowsAzure.ServiceRuntime Verbose: 502 : Role instance status check succeeded: Ready
Microsoft.WindowsAzure.ServiceRuntime Verbose: 500 : Role instance status check starting
Microsoft.WindowsAzure.ServiceRuntime Verbose: 502 : Role instance status check succeeded: Ready
Microsoft.WindowsAzure.ServiceRuntime Verbose: 500 : Role instance status check starting
Microsoft.WindowsAzure.ServiceRuntime Verbose: 502 : Role instance status check succeeded: Ready
iisexpress.exe Warning: 0 : WARNING: <DistributedCache.SocketClientChannel.1> Request 1 to host net.tcp://127.255.0.0:20004/ failed Status=ChannelOpenFailed[System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.255.0.0:20004
at Microsoft.ApplicationServer.Caching.AsyncResultNoResult.EndInvoke()
at Microsoft.ApplicationServer.Caching.AsyncResult`1.EndInvoke()
at Microsoft.ApplicationServer.Caching.TcpClientChannelFactory.EndConnect(IAsyncResult asyncResult)
at Microsoft.ApplicationServer.Caching.TcpClientChannel.ConnectionCallback(IAsyncResult result)]
iisexpress.exe Warning: 0 : WARNING: <SimpleSendReceiveModule> d8c9fa85-ded3-48ad-94a3-ec31e2123bb3:Request - 1, result - Status=ChannelOpenFailed[System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.255.0.0:20004
通过研究,我发现 127.255.X.X
IP 是模拟器从其内部负载均衡器生成的 IP。我不明白的是为什么我的机器决定不想接受此连接。我已经关闭了所有防火墙,重新安装了 Visual Studio,完全重新安装了 Windows Azure,但仍然没有运气。它绝对不是基于代码的,因为我的同事和我的辅助机器没有问题。然而,使用我的第二台机器并不可取,所以我想让这台机器工作,并且我想找到一种不涉及完全格式化我的机器的解决方案,这就是我目前的知识所在。
当前运行的是 2012 年 10 月版的 azure、Visual Studio 2012 和 .net 4.5。
如有任何帮助,我们将不胜感激。
最佳答案
我在 Windows 8 下使用 Azure SDK 2.0 时遇到了类似的问题,而在 Windows 7 下使用 Azure SDK 1.8 时没有遇到任何问题。像您一样,我最初也想到了与网络相关的问题。然后,我尝试禁用缓存,并注意到我的云项目中的其他角色正确地注意到缓存服务不可用,并显示另一条错误消息。
根据我的经验,该问题可能与您的区域设置有关,特别是与指定长时间格式的方式有关。我从这个SO question发现缓存模拟器使用 logman.exe
出于记录目的,它使用区域设置中的长时间格式将持续时间传递给 cnf
参数(例如,在我的 Windows 8 计算机中使用意大利语设置的 HH.mm.ss
) -- 但实际上 cnf
要求持续时间完全采用 HH:mm:ss
格式(使用冒号而不是点)。更改长时间格式后,缓存开始在计算机模拟器中正常工作。
您还可以考虑以下解决方案:
- 按照此 thread on MSDN forums 中的建议重新启动计算机;
- 按照此 SO thread 中的建议使用两个实例进行缓存.
关于使用模拟器时 Windows Azure 目标计算机主动拒绝连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15128447/