473,398 Members | 2,525 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,398 software developers and data experts.

Console.Writeline() hangs IDE?

Bob
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 at a line in a referenced assembly, one of
my own, which is a simple Console.WriteLine() statement. The stack trace shows
this line one level under the current frame, which is displayed as [<Non-user
Code>].

Anyone seen this behavior before, know what causes it?

TIA,
Bob

Nov 20 '05 #1
4 2943
* "Bob" <no*****@nospam.net> scripsit:
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 at a line in a referenced assembly, one of
my own, which is a simple Console.WriteLine() statement. The stack trace shows
this line one level under the current frame, which is displayed as [<Non-user
Code>].

Anyone seen this behavior before, know what causes it?


Never seen before. Does that only occur at /one/ call to
'Console.WriteLine' or does this even occur in, for example, a blank or
a very simple project?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Bob
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Never seen before. Does that only occur at /one/ call to
'Console.WriteLine' or does this even occur in, for example, a blank or
a very simple project?


Yes. This will cause a hang (as described in my original post) at iteration 20
in the loop below.

Module Main

Public Sub Main()
For i As Integer = 1 To 20
Console.WriteLine("console writeline output " & i)
Next
End Sub

End Module

The problem seems to be related to the amount of data sent to the console,
beacuse the loop below causes a hang at 11:

For i As Integer = 1 To 11
Console.WriteLine("console writeline output console writeline output console
writeline output " & i)
Next

If I make another simple project with a form and do Console.Writeline on a
button click, none of the output shows up until the application exits. And if
this output exceeds a ciritcal limit, it hangs just like in the first project.

I'd really like to know what's up with this one. But if no one else can
reproduce it, maybe I'll just have to reinstall VS.

Bob

Nov 20 '05 #3
Bob,

Rather than play the "hit or miss" game... test your theory by instantiating
various string with a fixed number of characters such as: Dim test As String
= New String("X",2048) Choose a large value (20 times the length of your
current string for instance) and see if it is in fact the length of the
output. Then reduce the value by half until it doesn't fail. You should be
able to hit the exact length if that is a factor.

What it sounds like (but who knows what it really is) is that the output is
being redirected to some device (like an empty parallel or serial port) and
when that buffer gets full the process blocks waiting for acknowledgement.

Did it ever work? Did it just start doing it out of the blue or is this a
recent installation?

Tom

"Bob" <no*****@nospam.net> wrote...
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Never seen before. Does that only occur at /one/ call to
'Console.WriteLine' or does this even occur in, for example, a blank or
a very simple project?
Yes. This will cause a hang (as described in my original post) at

iteration 20 in the loop below.

Module Main

Public Sub Main()
For i As Integer = 1 To 20
Console.WriteLine("console writeline output " & i)
Next
End Sub

End Module

The problem seems to be related to the amount of data sent to the console,
beacuse the loop below causes a hang at 11:

For i As Integer = 1 To 11
Console.WriteLine("console writeline output console writeline output console writeline output " & i)
Next

If I make another simple project with a form and do Console.Writeline on a
button click, none of the output shows up until the application exits. And if this output exceeds a ciritcal limit, it hangs just like in the first project.
I'd really like to know what's up with this one. But if no one else can
reproduce it, maybe I'll just have to reinstall VS.

Bob

Nov 20 '05 #4
Bob
927 is the magic number.

This is not a new installation, yet it just started happening recently.

Bob

Module Main

Public Sub Main()
Dim test As String = New String("X"c, 927)
Console.WriteLine(test)
End Sub

End Module
"Tom Leylan" <ge*@iamtiredofspam.com> wrote in message
news:OR****************@tk2msftngp13.phx.gbl...
Bob,

Rather than play the "hit or miss" game... test your theory by instantiating
various string with a fixed number of characters such as: Dim test As String
= New String("X",2048) Choose a large value (20 times the length of your
current string for instance) and see if it is in fact the length of the
output. Then reduce the value by half until it doesn't fail. You should be
able to hit the exact length if that is a factor.

What it sounds like (but who knows what it really is) is that the output is
being redirected to some device (like an empty parallel or serial port) and
when that buffer gets full the process blocks waiting for acknowledgement.

Did it ever work? Did it just start doing it out of the blue or is this a
recent installation?

Tom


Nov 20 '05 #5

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

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
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...
5
by: Publicjoe | last post by:
I am working on a little app which uses colour in the console window. I have created a class to extend the console functionality but the ClearScreen method does not work correctly. I am enclosing a...
17
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to...
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...
3
by: Urs Eichmann | last post by:
I have a console app which does it's job and frequently spits out status messages with Console.Writeline. I noticed that, if the user accidentally clicks into the black console window, the cursor...
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...
0
by: Zorquel | last post by:
I have an application that I want to accept command line arguments and if there are no command line arguments then go ahead and display the form and run it normally. However, if I use the command...
1
by: John Wright | last post by:
I am running a console application that connects to an Access database (8 million rows) and converts it to a text file and then cleans and compacts the database. When it runs I get the following...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.