locked
debug.writeline doesn't work RRS feed

  • Question

  • I recently upgraded from VS 2008 to VS 2010.  I configured it for Visual Basic.

    Every program that I have written uses debug.writeline for debugging purposes.  It worked great in VS 2008 and it doesn't work at all in VS 2010.  I have done all of the searches and checked all of the forums and nothing is working.  I have check to make sure that I am configured for debug, I have reset all of my settings, etc.

    The interesting things is that when I step through my code, it skips over the debug statements.  I think that it has something to do with how the compiler or debugger is configured.  For some reason, it isn't evaluating debug statements.

    This is driving me nuts.  I need to fix a program and I can't tell what it is doing because the debug statements don't work.

    Please advise.

    John

     

     

     


    John
    Thursday, September 22, 2011 3:46 PM

Answers

  • Ensure to use the right Debug configuration as David suggested.
    Debugging -> General
    uncheck [Redirect all Output Window text to the Immediate Window]
    Debugging -> Output Window
    Ensure you turn on the outputs.

    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Mike Dos Zhang Wednesday, September 28, 2011 6:14 AM
    • Marked as answer by Mike Dos Zhang Thursday, September 29, 2011 11:57 AM
    Saturday, September 24, 2011 3:43 AM
  • >The interesting things is that when I step through my code, it skips over the debug statements.

    It sounds like you've not actually got a debug build - or your debug
    configuration isn't really a debug config.

    Dave

    • Proposed as answer by Mike Dos Zhang Wednesday, September 28, 2011 6:14 AM
    • Marked as answer by Mike Dos Zhang Thursday, September 29, 2011 11:57 AM
    Thursday, September 22, 2011 3:57 PM

All replies

  • >The interesting things is that when I step through my code, it skips over the debug statements.

    It sounds like you've not actually got a debug build - or your debug
    configuration isn't really a debug config.

    Dave

    • Proposed as answer by Mike Dos Zhang Wednesday, September 28, 2011 6:14 AM
    • Marked as answer by Mike Dos Zhang Thursday, September 29, 2011 11:57 AM
    Thursday, September 22, 2011 3:57 PM
  • Ensure to use the right Debug configuration as David suggested.
    Debugging -> General
    uncheck [Redirect all Output Window text to the Immediate Window]
    Debugging -> Output Window
    Ensure you turn on the outputs.

    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Mike Dos Zhang Wednesday, September 28, 2011 6:14 AM
    • Marked as answer by Mike Dos Zhang Thursday, September 29, 2011 11:57 AM
    Saturday, September 24, 2011 3:43 AM
  • I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?

    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, September 28, 2011 6:14 AM
  • Whilst learning how to use TraceSources, Listeners & Switches, i lost 2 days simply due to the fact that i couldn't even get the basics to work...

                Debug.WriteLine("This is a Debug message");
                Trace.WriteLine("This is a Trace message");
    
    

    ...zero response in the Output window.  absolutely nothing!

    i had my compilation constants set in the project properties, i was using #define TRACE etc and still couldn't get it to work!

    stumbled across this just now......  thank you Mike.  a thousand times!

    matt

    Thursday, September 29, 2011 1:15 PM
  • I did not have "Debug" selected.

    I tried it and it still didn't work but it was now evaluating the debug messages so it was a step in the right direction.

    I enabled "Redirect all Output Window text to the Immediate Window" and it started working.

    Thanks for your help!

    John


    John
    Saturday, October 8, 2011 9:42 PM
  • You're welcome, and have a nice weekend, John!
    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, October 9, 2011 12:24 PM



  • I recently upgraded from VS 2008 to VS 2010.  I configured it for Visual Basic.

    Every program that I have written uses debug.writeline for debugging purposes.  It worked great in VS 2008 and it doesn't work at all in VS 2010.  I have done all of the searches and checked all of the forums and nothing is working.  I have check to make sure that I am configured for debug, I have reset all of my settings, etc.

    The interesting things is that when I step through my code, it skips over the debug statements.  I think that it has something to do with how the compiler or debugger is configured.  For some reason, it isn't evaluating debug statements.

    This is driving me nuts.  I need to fix a program and I can't tell what it is doing because the debug statements don't work.

    Please advise.

    John

     

     

     


    John

    please make sure you checked the define debug constant in the property of the solution.

     

    Friday, November 25, 2011 3:17 PM