.net 调试

http://www.cnblogs.com/xzwplus/archive/2008/03/30/1129452.html

 

需要跟踪调试一些不方便调试的代码时,如windows服务,可在代码中加入如下代码以进入调试:

protected override void OnStart(string[] args){

#if DEBUG
        Debugger.Launch();    //Launches and attaches a debugger to the process.
#endif
        // TODO: add your initialize code here.
    } 
posted @ 2014-11-25 11:58  我来也是真的呀  阅读(104)  评论(0编辑  收藏  举报