472,783 Members | 993 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 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 2911
* "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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.