, , OnStart Windows, , , .
protected override void OnStart(string[] args)
{
if (args.Contains("DEBUG_SERVICE))
DebugMode();
DebugMode();
}
private static void DebugMode()
{
Debugger.Break();
}
Brian Gideon also makes a good conclusion about the need to "deploy a new thread or otherwise somehow start his logic asynchronously." If you are not responding to a system event or are not listening on a network port, use a timer to do this. My answer contains a sample that I use as a template.
source
share