Re: System.Console.WriteLine question

From: Ian Griffiths [C# MVP] (ian-interact-sw_at_nospam.nospam)
Date: 11/25/04


Date: Thu, 25 Nov 2004 11:32:09 -0000

There are various tools out there that let you look at the debug output
stream without having to attach a debugger. Here's one:

  http://www.sysinternals.com/ntw2k/freeware/debugview.shtml

But if you want to do logging, then look at the Trace class. Or if you want
a lot of flexibility, consider looking at the log4net project.

-- 
Ian Griffiths - http://www.interact-sw.co.uk/iangblog/
DevelopMentor - http://www.develop.com/
"Thomas P. Skinner [MVP]" wrote:
> Yes. This works as long as you run the application under VS.NET under 
> debug mode. The output from Debug.WriteLine calls goes to the output 
> window. I was thinking the question was geared more to a type of 
> logging/monitoring rather than debugging.
>
> I often change the build to a console build for a Windows Forms 
> application for just such a purpose. When you do that you get a console 
> window that you can use Console.WriteLine to output to. This works 
> regardless of whether you run the program from VS.NET or not.
>
> Thomas P. Skinner [MVP]
>
> "Benjamin" <csharp.25.jc99@spamgourmet.com> wrote in message 
> news:u2HoWun0EHA.3704@tk2msftngp13.phx.gbl...
>> Thomas P. Skinner [MVP] wrote:
>>> Unfortunately I don't think you can use Console. Apparently standard 
>>> input and standard output are not mapped to the console for an ASP.NET 
>>> application. I would suggest opening a file and writing to the file for 
>>> logging purposes. I ran into this issue some time ago. You are not 
>>> missing anything.
>>>>
>>>>Ps: Back in the good old days we had something called "TRACE" ;-)
>>
>> Couldent you just use System.Diagnostics.Debug.WriteLine for this? 


Relevant Pages

  • Re: Debug output showing on pocket pc
    ... Usually the question is "Where has my debug output gone" so consider ... > Ive just received a new model Pocket pc to work with, ... > Studio .net 2003 they're appearing in a console window on the Pocket pc. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Where does Console::write() output text appear?
    ... > I've got some stdout print statements in the code ... ... which would be the console if you'd developed a console ... If you run under the debugger, stdout from WinForms app goes to ... the Output window in the debugger. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Why does console window appear
    ... I'm used to the kernel debugger, not EVC/PocketPC development, ... Put a simple printf() statement at the beginning of your app and load the ... On actual shipping devices that don't have a console, ... >>> At a guess, the program is opening the window, either because it's ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: working set and console applications
    ... I created a windows application and then I created a child console process ... that I started from the parent process using CreateProcess. ... I minimize the child console window it also causes the working set of the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Console applications window size
    ... AllocConsole() or AttachConsole. ... You already have a console, ... SMALL_RECT srWindowRect; // hold the new window size ... >exe from a cmd prompt, the same cmd prompt gets bigger properly. ...
    (microsoft.public.vc.language)