Why does my C # program pause so often when it starts from the Windows 7 command prompt?

I had this problem with several different C # applications. These are all useful programs that I wrote to make my life easier as an administrator. Things like moving data between database servers.

They print their current step on the console (old versions through System.Console.WriteLine (), newer through log4net ConsoleAppender), so I always run them from the command line. However, they often seem to be pauses in random intervals, until I hit several times. I notice that they are paused because the step, which usually takes a second or two, has been on the screen for a long time. After entering the game, things begin to process normally for a while.

Why is this? How can i fix this?

+4
source share
2 answers

If you select text on the command window screen with the mouse, it often pauses the execution of a running program. Perhaps you accidentally create text when you click on the window.

+9
source

The simplest assumption is that the application goes into the branch with a call to Console.ReadLine() . Not enough information to make any other assumption. In the end, try initiating the Break command in the debugger while the program freezes, etc.

0
source

Source: https://habr.com/ru/post/1385396/


All Articles