其他分享
首页 > 其他分享> > msvsmon远程调试启动时挂起真正有效办法

msvsmon远程调试启动时挂起真正有效办法

作者:互联网

正确方法

while (!Debugger.IsAttached) {
                Thread.Sleep(1000);
}
//下面开始你的代码

以下2中检测调试都无效

 [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
 private static extern bool IsDebuggerPresent();
 [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
 static extern bool CheckRemoteDebuggerPresent(IntPtr hProcess, ref bool isDebuggerPresent);

标签:时挂,ExactSpelling,kernel32,DllImport,bool,static,msvsmon,true,调试
来源: https://blog.csdn.net/oShuangYue12/article/details/104821832