System.Diagnostics.Debugger.Debug() stopped working

后端 未结 4 1856
时光取名叫无心
时光取名叫无心 2020-12-10 13:42

I\'m working on a program which uses the System.Diagnostics.Debugger.Break() method to allow the user to set a breakpoint from the command-line. This has worked fine for ma

4条回答
  •  盖世英雄少女心
    2020-12-10 14:04

    I finally figured out what was happening. For some reason, something changed on my machine so that just calling Debugger.Debug wasn't sufficient anymore (still don't understand what changed). In any case, I can now cause the debugger to come up by using:

    if (Debugger.IsAttached == false) Debugger.Launch();
    

提交回复
热议问题