First question, are you compiling your code with the Debug configuration? If not then the call to Debug.WriteLine
will be stripped out of the code at compilation. Note that this isn't the same as selecting the option to debug your program (F5).
Secondly, check your compilation settings for the project. For a debug configuration the DEBUG
symbol will be defined. Unless you mucked with the settings this should be default.
Thirdly, you are debugging this project and it doesn't have any compilation errors right? It should be in bold in Solution Explorer, hence the startup project. Also if it has compiler errors and you simply press F5 then the IDE will offer to run the code anyway. If you select yes then it is running the last successfully built version, not the current version and this gets really confusing.
If none of that helps then show the output window without the context menu pop up along with your project file contents (you can remove file itemgroups to keep it short).