423,682 Members | 1,622 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,682 IT Pros & Developers. It's quick & easy.

Console.Writeline() hangs IDE?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
* "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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.