none
System.Diagnostics.Trace.Writeline not working in Visual Studio 2008 RRS feed

  • Question

  • Yesterday I saw the trace results in the output window, but today they don't appear.  What could cause it to stop working?  There was a windows update that happened this morning (just Windows Defender) but that shouldn't cause a problem in Visual Studio.

    To test, I created a brand new tiny C# console program

        class Program {
            static void Main(string[] args) {
                System.Diagnostics.Trace.WriteLine("hello world");
            }
        }

    Running in debug mode in VS2008, I got the "hello world" when it was running on my windows 2003 server, but not on my main (Windows 7) computer.  Could my VS2008 installation have been corrupted somehow?  Are there any configuration options somewhere which could cause this?

    I'm at a loss :-(, any ideas much appreciated.  Best wishes, Paul

    Update: (1) ATLTRACE in C++ also fails to put anything in the output window, whereas previously it worked fine. (2) If I add a System.Diagnostics.TextWriterTraceListener object into System.Diagnostics.Trace.Listeners then the trace messages do get sent to file specified.

    Tuesday, October 16, 2012 9:18 AM

Answers

All replies

  • Hi Paul,

    Welcome to the MSDN Forum.

    Your issue is not related to this forum.

    But I suggest you try to reset your VS settings: http://msdn.microsoft.com/en-us/library/ms247075(v=vs.100).aspx 

    I hope this will resolve this issue.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Stochastically Wednesday, October 17, 2012 10:32 AM
    Wednesday, October 17, 2012 8:55 AM
    Moderator
  • Thanks Mike, that worked :-).  Warm regards, Paul 

    PS: Apologies for posting in this forum.  With so many forums, it can be a nightmare for occasional users like me to know which the correct forum is.  I only chose this one because there had been other posts here which mentioned System.Diagnostics.Trace.WriteLine etc!

    Wednesday, October 17, 2012 10:35 AM
  • Hi Paul,

    You are welcome.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, October 17, 2012 10:52 AM
    Moderator