Debug.WriteLine not working

前端 未结 13 2036
梦毁少年i
梦毁少年i 2020-12-03 03:07

In the past, perhaps versions of Visual Studio prior to the 2008 that I am using now, I would do something like this in my VB.NET code:

System.Diagnostics.De         


        
13条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 03:22

    Some extra ideas to try or check:

    • Put a breakpoint before Debug.WriteLine and see what's in System.Diagnostics.Trace.Listeners collection. You should see DefaultTraceListener. If you don't see anything, then no one is listening and that's problem.
    • Is it possible that the trace listeners being cleared/modified somewhere such as in config file or in the code?
    • Have you installed any package or add-in to Visual Studio? or using a third-party library?
    • Can you see debug messages outside of VS? There is a SysInternals application called DebugView that monitors and shows debug output in your system. Run that tool and then run your application. You should see your debug message in DebugView. At least you will know that your application is outputting debug messages but VS does not seem to be listening.
    • Have you gone through the contents of the output window to see if there is any exception or error being reported. Your debug output is not there but there might be somethings in there that can provide some clues.

提交回复
热议问题