开发者

Is it possible to detect within a .Net program that it is being stopped/stepped through in the debugger?

开发者 https://www.devze.com 2023-04-10 17:47 出处:网络
This is to address an issue that bothers my debugging at times. The program I\'m working on detects user inactivity in the UI (mouse + keyboard) and time-outs if the user has no activity over a config

This is to address an issue that bothers my debugging at times. The program I'm working on detects user inactivity in the UI (mouse + keyboard) and time-outs if the user has no activity over a configurable time span. The problem I'm having is that the user inactivity is counted even if I'm debugging开发者_如何学Go the program and I would like to have the ability to substract the time I spend in the debugger from the user inactivity time, so the program does not time out while I am debugging it.


You could just disable the timeout code in the DEBUG builds of your application.


You could use compiler directives.

http://msdn.microsoft.com/en-us/library/4y6tbswk.aspx

0

精彩评论

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

关注公众号