以前我做了很多 WinForms 组件,我们有类似“InDesigner”的东西。我想知道是否有类似“IsWithDebuggerAttached”的东西。
您可以调查System.Diagnostics.Debugger.IsAttached。这将告诉您调试器是否附加到您的应用程序。是否是 Visual Studio 是另一回事。
从
System.Diagnostics
Debugger.IsAttached