开发者

.NET application hangs and I can't debug it

开发者 https://www.devze.com 2023-01-27 15:42 出处:网络
I\'m working on a multithreaded C# server for Syslog. I\'m trying to perform a long-running experiment, but I found that after one hour the server hangs (after a certain time, logging stops).

I'm working on a multithreaded C# server for Syslog. I'm trying to perform a long-running experiment, but I found that after one hour the server hangs (after a certain time, logging stops).

I tried then to run it in Debug mode in Visual Studio and when I found it hanging and tried to press Pause in order to get useful information on where the threads were, Vis开发者_如何学Pythonual Studio said that Remote Debugging Monitor crashed. It's a local application.

What can I do to pause the process and get useful information about thread status?


Managed stack explorer will poll a managed application and log what is currently happening.

This article may also be useful (section about hang mode dump), but will require debugging a crash dump file (WinDbg is not as easy to absorb as Visual Studio and will take some time to learn).


I would try StingyJack's recommendation but I believe there is no replacement for lightweight tracing using Debug.WriteLine() and using Sysinternal's DebugView to see what is happening.

This would be where I would start. VS is not powerful enough to help you debug a multi-threaded service. It can sometimes even lie on the state of objects and bear in mind, when you are debugging, you disrupt the normal flow of events.


WinDBG is a good alternative for low level issues that VS cannot trap. You can find more information here: Debugging Tools for Windows

0

精彩评论

暂无评论...
验证码 换一张
取 消