473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Fun, Games and Disaster with Console.Writeline

We were using Console.Writeline from within our app, to do some routine
debugging.

And then we started having random problems when the code was run by a
tester, on their own machine. We couldn't replicate these problems on
the developer machines.

And then we eventually worked out that on the dev machines Console
output was going to a window, and on the test machines it was
going....nowhere.

Does anyone know where Console.Writeline output goes when there's no
console? Is it being logged to a buffer that eventually overflows,
causing an exception later? Anyone? And if so, is there any way
around this than never, ever using Console.Writeline from a GUI app?

Cheers,

Andy D

Feb 25 '06 #1
3 1691

"Andrew Ducker" <an****@ducker.org.uk> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
We were using Console.Writeline from within our app, to do some routine
debugging.

And then we started having random problems when the code was run by a
tester, on their own machine. We couldn't replicate these problems on
the developer machines.

And then we eventually worked out that on the dev machines Console
output was going to a window, and on the test machines it was
going....nowhere.

Does anyone know where Console.Writeline output goes when there's no
console? Is it being logged to a buffer that eventually overflows,
causing an exception later? Anyone? And if so, is there any way
around this than never, ever using Console.Writeline from a GUI app?

Cheers,

Andy D


Console output goes nowhere when no console is attached to the process, that
is when the program is build using /target:WinExe.
Output is not buffered and is simply lost.
So your problems must be searched elsewere.
Note that you should not use Console.Write in UI applications, for debugging
pursposes you should use Debug.Write/WriteLine.

Willy.

Feb 25 '06 #2

"Andrew Ducker" <an****@ducker.org.uk> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
We were using Console.Writeline from within our app, to do some routine
debugging.

And then we started having random problems when the code was run by a
tester, on their own machine. We couldn't replicate these problems on
the developer machines.

And then we eventually worked out that on the dev machines Console
output was going to a window, and on the test machines it was
going....nowhere.

Does anyone know where Console.Writeline output goes when there's no
console? Is it being logged to a buffer that eventually overflows,
causing an exception later? Anyone? And if so, is there any way
around this than never, ever using Console.Writeline from a GUI app?

Well, I'm not sure what happens to the Console output in a program which
doesn't have a console. I think Console.WriteLine just goes into the bit
bucket.

But you shoudn't use Console.WriteLine in the first place. Use
Trace.WriteLine instead.

In a console program add a TraceListener to output Trace data to the
console, and it will appear there. In a GUI program or a service add a
TraceListener to putput Trace to a file, or a window or whatever. Or attcah
no TraceListener and the output will go into the bit bucket.

David

Feb 25 '06 #3

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> wrote in
message news:ux**************@TK2MSFTNGP10.phx.gbl...

"Andrew Ducker" <an****@ducker.org.uk> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
We were using Console.Writeline from within our app, to do some routine
debugging.

And then we started having random problems when the code was run by a
tester, on their own machine. We couldn't replicate these problems on
the developer machines.

And then we eventually worked out that on the dev machines Console
output was going to a window, and on the test machines it was
going....nowhere.

Does anyone know where Console.Writeline output goes when there's no
console? Is it being logged to a buffer that eventually overflows,
causing an exception later? Anyone? And if so, is there any way
around this than never, ever using Console.Writeline from a GUI app?

Well, I'm not sure what happens to the Console output in a program which
doesn't have a console. I think Console.WriteLine just goes into the bit
bucket.

But you shoudn't use Console.WriteLine in the first place. Use
Trace.WriteLine instead.

In a console program add a TraceListener to output Trace data to the
console, and it will appear there. In a GUI program or a service add a
TraceListener to putput Trace to a file, or a window or whatever. Or
attcah no TraceListener and the output will go into the bit bucket.


Get the free debugview http://www.sysinternals.com/Utilities/DebugView.html
and you can avoid all the trace listener stuff and get some nice filtering
as well
Feb 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jabailo | last post by:
This is driving me crazy. I finally got the Remoting sample chat application working almost. When I run the chat client in VS.NET it goes into an endless loop -- that's because I assume that...
7
by: shawnk | last post by:
Hello Everyone How do you format format numbers right-justified using Console.WriteLine(), i.e I need to line up numbers in vertical columns and the MSDN documentation is pretty poor Here is the...
3
by: Roy Gourgi | last post by:
Hi, How would I set the width of lnSize to 6 in the statement Console.WriteLine("Size of {0} ", lnSize); Furthermore is there a way to combine these 3 statements into 1 ...
5
by: portroe | last post by:
Hi I am using console.Writeline in my simple program. I do not however see anything happening in the output window when I debug, there are also no error messages, Has anybody a tip on what...
4
by: Bob | last post by:
I just recently noticed that when I start my applicatoin in debug mode, the IDE hangs (no disk or CPU activity) indefinitely (at least 20 minutes). Pausing the application shows that it's hung up...
4
by: Leszek | last post by:
Can someone help me? Im trying to use console.writeline with ciag1. Application must read string, split it by "," and show every section between ",". Dim serwery_split() Dim elementy As...
2
by: djc | last post by:
out of all the overloads that pop up via intellisense for console.writeline() the following one confuses me: Console.WriteLine (string format, params object arg) 1) whats the deal with...
3
by: Tracey | last post by:
How I can have the cursor remain at the end of the 2nd Console.WriteLine - (without a <carriage-return>/<line-feed>) Console.WriteLine("Hello World") Console.WriteLine("Press <enterto continue: ")...
1
by: =?Utf-8?B?RXJpayBFY2toYXJkdA==?= | last post by:
I am trying to create a class or function which does one extra thing then performs a normal Console.WriteLine, preferrably with all the overloads available and intact. Where I currently have: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.