Is it possible to detect within a .Net program that it is being stopped/stepped through in the debugger?
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
精彩评论