问题描述
当我在本地调试我的Azure项目(1个Web + 1 Worker Role实例)时,调试器通常只是停止,角色实例重新启动。
不知道为什么会发生这种情况,没有未知的例外,如果我运行项目而不设置断点,一切都可以正常运行。
但是,当我设置断点并使用Step Over / Step into进行代码时,调试器只会以随机的间隔停止。
有谁知道是什么原因这个/我可以在哪里找到可能揭示这一点的其他日志?
更新:
我以前忽略了这个,或者没有记录到输出窗口,但是我现在得到以下错误:
WaWorkerHost.exe中的0x000007fde4a4167f的首例机会异常:0xC0000005:访问冲突读取位置0xfffffffffffffff8。
公共语言运行时不能停止在此异常。常见原因包括:错误的COM互操作编组和内存损坏。要进一步调查,使用纯本机调试。
我很确定这不是我的应用程序的错误 - 正如我所提到的,我确切的代码当我不设置断点并手动逐步执行时,调试运行正常。
任何想法?
更新2 :
从Bootstrapper(旧)日志中:
[00012264:00001260,2013/03/26 ,11:37:19.777,00100000]< - CRuntimeClient :: OnRoleStatusCallback(0x0000006BD7718C00)= 0x800706be
[00012264:00008432,2013/03/26,11:37:19.804,00100000]< - CRuntimeAgent :: RemoveEndpointRegistration(0x0000006BD76F60E0)= 0x80070005
[00012264:00001260,2013/03/26,11:37:19.811,00040000]客户端进程WaWorkerHost.exe是角色主机。
[00012264:00008432,2013/03/26,11:37:19.830,00100000]< - - CRuntimeAgent :: UnregisterEndpoint(0x0000006BD76F60E0)= 0x80070005
[00012264:00001260,2013/03/26, 11:37:19.830,00080000]无法联系角色主机进程。把角色当作不健康。
文件以此结尾 - 在下一个引导程序日志中,正在记录角色实例的启动。
可否调试阻止引导程序联系角色,从而确定他们不健康,必须重新启动?
最后更新:
我擦除了我的项目,并从存储库中进行了新的结帐。事实证明,我的一个类库中有一个缺失的引用。缺少的引用从来没有显示为编译错误,据说是因为有一个旧版本放在某个地方。
对于发现自己处于类似情况的所有其他人,我只能建议尝试执行相同操作:完全清理代码库,看看问题是否消失。在我搜索的所有日志中,我从未遇到过MissingReferenceException - 今天将为我节省很多时间
更新2
WaHostBootstrapper 日志位于 C:\Resources\Directory\DeploymentID.Role.DiagnosticStore\WaHostBootstrapper.log
其他日志:
WaWebHost
C:\Resources\Temp\Guid.Role\RoleTemp\\ \\WaWebHost.log
WaIISHost
C:\Resources\Temp\DeploymentID。角色\RoleTemp\WaIISHost.log
IISConfigurator
C:\Resources\ Temp\DeploymentID.Role\RoleTemp\IISConfigurator.log
IIS日志
C :\Resources\Directory\Guid.Role.DiagnosticStore\LogFiles\W3SVC1
Windows事件日志
D:\Windows\System32\Winevt\Logs
更新3
在Azure应用程序中定义本地存储创建一个新文件夹,以便您的Azure Compute Emulator的路径为%USERPROFILE%\AppData\Local\dftmp\
When I'm debugging my Azure project (1 Web + 1 Worker Role instance) locally, the debugger often just stops and the role instances are restarting.
I have no clue why this is happening, there are no uncaught exceptions and if I run the project without setting breakpoint everything works just fine.However when I set breakpoints and move through the code using Step Over / Step into, the debugger just stops at random intervals.
Does anyone know what is causing this / where I can find additional logs that may shed some light on this?
Update:
Either I overlooked this previously or it didn't get logged to the Output window, but I now got the following error:
First-chance exception at 0x000007fde4a4167f in WaWorkerHost.exe: 0xC0000005: Access violation reading location 0xfffffffffffffff8.
The Common Language Runtime cannot stop at this exception. Common causes include: incorrect COM interop marshalling, and memory corruption. To investigate further, using native-only debugging.
I'm pretty sure that's not my application's fault – as I mentioned, the exact code I'm debugging runs fine when I don't set breakpoints and step through manually.
Any ideas?
Update 2:
Frome the Bootstrapper (old) log:
[00012264:00001260, 2013/03/26, 11:37:19.777, 00100000] <- CRuntimeClient::OnRoleStatusCallback(0x0000006BD7718C00) =0x800706be
[00012264:00008432, 2013/03/26, 11:37:19.804, 00100000] <- CRuntimeAgent::RemoveEndpointRegistration(0x0000006BD76F60E0) =0x80070005
[00012264:00001260, 2013/03/26, 11:37:19.811, 00040000] Client process WaWorkerHost.exe is the role host.
[00012264:00008432, 2013/03/26, 11:37:19.830, 00100000] <- CRuntimeAgent::UnregisterEndpoint(0x0000006BD76F60E0) =0x80070005
[00012264:00001260, 2013/03/26, 11:37:19.830, 00080000] Failed to contact the role host process. Treat role as unhealthy.
The file ends with that – in the next bootstrapper log, the startup of role instances is being logged.Can it be that debugging prevents the bootstrapper from contacting roles and thus deciding they are unhealthy and must be restarted?
Last Update:
I wiped my project and did a fresh checkout from the repository. As it turns out, there was a missing reference in one of my class libraries. The missing reference never showed up as compile error, supposedly because there was an older version laying around somewhere.
To all others that find themselves in a similar situation, I can only recommend trying to do the same: completely cleaning their code base and see if the issue disappears. In all the logs I searched I never encountered a "MissingReferenceException" – would have saved me a lot of time today
Enable Diagnostics in Windows Azure
UPDATE 1
You could try enabling the logs
Go to %USERPROFILE%\AppData\Local\DevelopmentStorage directory. You'll see two files
Open file DevelopmentStorage.201210.config and change LoggingEnabled to true.
References:
Windows Azure worker role crashingWaWorkerHost.exe crashes role
UPDATE 2
WaHostBootstrapper log is located in C:\Resources\Directory\DeploymentID.Role.DiagnosticStore\WaHostBootstrapper.log
Other logs:
WaWebHostC:\Resources\Temp\Guid.Role\RoleTemp\WaWebHost.log
WaIISHostC:\Resources\Temp\DeploymentID.Role\RoleTemp\WaIISHost.log
IISConfiguratorC:\Resources\Temp\DeploymentID.Role\RoleTemp\IISConfigurator.log
IIS LogsC:\Resources\Directory\Guid.Role.DiagnosticStore\LogFiles\W3SVC1
Windows Event LogsD:\Windows\System32\Winevt\Logs
UPDATE 3
Defining local storage in Azure Application creates a new folder so path to your Azure Compute Emulator is %USERPROFILE%\AppData\Local\dftmp\
这篇关于调试Azure项目时,Visual Studio 2012调试器突然停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!