我将Windows Azure项目设为工作者角色 ..它具有简单的WCF服务。 当我在本地系统上运行它时,计算模拟器会给我以下错误...
我安装了最新的Azure SDK工具包。请告诉我为什么会出现这种错误。
at Microsoft.WindowsAzure.Diagnostics.ControlChannel.GetControlContainer() [Diagnostics]: Acquired mutex [Diagnostics] Information: C:\Users\kashif\AppData\Local\dftmp\Resources\85b2b7f8-61ec-499d-a473-b39674855c21\directory\DiagnosticStore\Monitor [Diagnostics] Information: C:\Users\kashif\Downloads\WCFWorkerRole\WCFWorkerRole\WCFWorkerRole\csx\Debug\roles\WCFWorker\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\kashif\AppData\Local\dftmp\Resources\85b2b7f8-61ec-499d-a473-b39674855c21\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\kashif\AppData\Local\dftmp\Resources\85b2b7f8-61ec-499d-a473-b39674855c21\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\kashif\AppData\Local\dftmp\Resources\85b2b7f8-61ec-499d-a473-b39674855c21\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-f615698470fe491ea136287908faa42c -InitializedEvent WADM-StartUp-f615698470fe491ea136287908faa42c -parent 11516 -events [MonAgentHost] Output: Agent will exit when WADDM-ShutDown-f615698470fe491ea136287908faa42c is signaled. [MonAgentHost] Output: Will signal WADM-StartUp-f615698470fe491ea136287908faa42c after the agent is initialized. [MonAgentHost] Output: Registered as an event consumer. [MonAgentHost] Output: Agent will exit when parent process 11516 exits. [MonAgentHost] Output: Monitoring Agent Started [Diagnostics]: Creating config channel server [Diagnostics]: Starting configuration channel polling [runtime] Role entrypoint . COMPLETED OnStart() [runtime] Role entrypoint . CALLING Run() Information: WCFWorker entry point called Information: Working Information: Working [MonAgentHost] Error: MA EVENT: 2012-06-04T13:40:32.487Z [MonAgentHost] Error: 2 [MonAgentHost] Error: 11292 [MonAgentHost] Error: 7264 [MonAgentHost] Error: NetTransport [MonAgentHost] Error: 0 [MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp [MonAgentHost] Error: OpenHttpSession [MonAgentHost] Error: 749 [MonAgentHost] Error: 0 [MonAgentHost] Error: 2f94 [MonAgentHost] Error: [MonAgentHost] Error: WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180) [MonAgentHost] Error: MA EVENT: 2012-06-04T13:40:32.504Z [MonAgentHost] Error: 2 [MonAgentHost] Error: 11292 [MonAgentHost] Error: 7264 [MonAgentHost] Error: NetTransport [MonAgentHost] Error: 0 [MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\xblobconnection.cpp [MonAgentHost] Error: XBlobConnection::SendBytesRequestAndGetHttpStatus [MonAgentHost] Error: 1980 [MonAgentHost] Error: ffffffff80050006
ServicePointManager.DefaultConnectionLimit = 12;
ServiceHost host;
IPEndPoint ip = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["port"].IPEndpoint;
Uri baseAddress = new Uri(String.Format("http://{0}/MyService", ip));
try { host = new ServiceHost(typeof(MessengerService), baseAddress); host.Open(); }
catch (Exception ex) { Trace.WriteLine(ex.Message, "Error"); throw; }
return base.OnStart();
答案 0 :(得分:2)
要解决此问题,您需要禁用“控制面板”中的“自动检测设置”选项 - >网络和互联网 - >互联网选项 - >连接 - >局域网设置。
答案 1 :(得分:1)
大多数情况下,此异常与Azure Development Storage启动过程直接相关。并且可能有几个原因导致您无法启动Azure Development Storage。 Azure开发存储依赖于本地SQL Server Express组件,因此有时与SQL Server组件相关的任何问题都可能导致此问题。
要确保Azure开发存储正在运行,请尝试在管理员模式下启动C:\ Program Files \ Windows Azure Emulator \ emulator \ csmonitor.exe,然后验证您是否可以手动运行计算模拟器和开发存储。
一旦上面的测试没有任何问题,请测试您的Worker Role + WCF应用程序,这应该可以让您顺利进行,如果Azure Storage运行正常时仍然看到问题,请在onStart()代码中显示您的worker角色。 (我还建议只创建一个非常简单的web或辅助角色hello world示例,看看是否会给你带来任何错误。这将证明你的SDK安装是否有任何问题)
添加更多内容:
您提供的错误消息“[MonAgentHost]错误:WinHttpGetProxyForUrl(http://127.0.0.1)失败ERROR_WINHTTP_AUTODETECTION_FAILED(12180)
“我的this blog中描述的是良性的。
接下来根据您的上述代码(和示例链接),我真的没有看到任何显示错误的异常:
您是否尝试过使用访问服务:
http://{0}/MyService
it would be http://127.0.0.1:9001/MyService if you have followed the sample code provided in the link?
你的OnStart()函数与你提供的链接中的函数差别很大,我希望你知道你在代码中做了什么,因为你上面提供的信息是完全不同的,除非你知道你是什么这样做,最好完全按照文章来匹配结果。