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
Check your Immediate Window. You might have all the output redirected to it.
Right-click in the output window, and ensure "Program output" is checked.
All good suggestions. I noticed that I don't see this tip mentioned, so I'll say it: In your app.config file, make sure you don't have a <clear/>
element in your trace listeners.
You will effectively be clearing the list of trace listeners, including the default trace listener used for Debug statements.
Here's what this would look like in your app.config file:
<system.diagnostics>
<trace>
<listeners>
<!-- This next line is the troublemaker. It looks so innocent -->
<clear/>
</listeners>
</trace>
</system.diagnostics>
If you want to have a placeholder for trace listeners in your app.config file, you should instead use something like this:
<system.diagnostics>
<trace>
<listeners>
</listeners>
</trace>
</system.diagnostics>
Do you definitely have the DEBUG constant defined? Check under project properties -> Compile -> Advanced Compile Options (there's a checkbox for the DEBUG constant. If it isn't checked, your Debug.XXX statements will not be executed).
It should go to the output window if your app is compiled with the Debug configuration rather than the Release configuration. But instead of Debug.WriteLine()
, try using Trace.WriteLine()
(optionally with a ConsoleTraceListener
attached).
It happens. I have the similar symptom when I am developing ASP.NET MVC applications on Visual Studio 2010 web developer Express Edition. The execution doesn't break at the breakpoint. There is no output when it executes System.Diagnostic.Debug.Writeline
(even though it runs with debug start), and there is nothing wrong with web.config
.
My workaround is: - Goto project properties--> web - In the Debugger section, check the the ASP.NET option
Hope this helps someone who comes across this thread.