C# Debugging in the intermediate window

Posted on 2012-08-13
Last Modified: 2012-09-13

I have some break points in my code. When they get hit I want to be able to check the values of my datareader. I used to use the writeline method in the intermediate window. However I can't remember or get it to work again.

I have the System.Diagnostics namespace so not sure what I'm doing wrong.

Any help would be great,

Question by:mcs26
    LVL 20

    Expert Comment

    Are you talking of Immediate window?

    CTRL + ALT + I
    LVL 7

    Expert Comment

    I think I know what you want to output some values to the Immediate Window when in debug mode, however, you are using the wrong write method. Try:


    Console.Write() and Console.WriteLine() only works in console apps. Try the Trace.Write() or Trace.WriteLine() instead.
    LVL 39

    Expert Comment

    by:Kyle Abrahams
    You can also manually interrogate by typing something like


    into the immediate window.
    LVL 13

    Accepted Solution

    You can also take advantage from the use of DebugView.
    It will show you both "Debug.Write" and "Trace.Write", depending on what configuration you are running.

    Author Comment

    Sorry for the delay in getting back.

    I have tried the suggestions above and still nothing. The intelii sense never picks up anymore when I type in the intermediate window. I should add I'm making an WPF application so not sure if that makes a difference?

    Thanks for any help,

    LVL 39

    Expert Comment

    by:Kyle Abrahams
    Intellisense doesn't always work in the immediate window.  You can try hitting ctrl + space to bring up the intellisense if available.  Also be sure that you're in debug mode and not building it for release.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now