Debug.Writeline is Not printing anything

Discussed already in the comments, but I wasn't sure until discussing it there. However:

  • calls to Debug.Whatever(...) are typically marked with [Conditional("DEBUG")], meaning they require the DEBUG symbol to be defined, otherwise those calls are not compiled
  • a default project has DEBUG and TRACE defined for the "Debug" profile, and TRACE for the "Release" profile
  • however, you can disable the DEBUG symbol via a checkbox in "project properties"

So; go to project-properties, and ensure the DEBUG symbol is defined (or not) as appropriate for your needs (for any-and-all profiles that exist in your project).


Make sure you press F5 to Start Debugging mode (not Ctr+F5).

F5 Starting Debugging

CTRL+F5 Starting Without Debugging

enter image description here

Tags:

C#

Debugging