开机不调试怎么调试?

How to debug after starting without debugging?

使用Visual Studio,是否可以显示像

这样的调试诊断消息
Debug.WriteLine("this is debugger");

首先"starting without debugging"然后附加到进程?似乎这样做不会在输出中显示任何调试信息window?不知道是不是漏了什么

您可以使用 Debugger.Launch(在安装了适当调试器的系统上),它会给您一个提示,让您有机会附加调试器的实例:

System.Diagnostics.Debugger.Launch();