<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx</link><description>If you start the debugger (F5) for a console application, and you don't have a Stop / Debugger.Break() or some sort of Console.Read() method, the console application window will appear and disappear in a flash. However, if you start the console application</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>  Did you know&amp;#8230; If you do a Ctrl+F5 on a console application, the console stays open - #317 : EasyCoded</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8958534</link><pubDate>Fri, 19 Sep 2008 13:12:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8958534</guid><dc:creator>  Did you know&amp;#8230; If you do a Ctrl+F5 on a console application, the console stays open - #317 : EasyCoded</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.easycoded.com/did-you-know-if-you-do-a-ctrlf5-on-a-console-application-the-console-stays-open-317/"&gt;http://www.easycoded.com/did-you-know-if-you-do-a-ctrlf5-on-a-console-application-the-console-stays-open-317/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8958593</link><pubDate>Fri, 19 Sep 2008 14:17:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8958593</guid><dc:creator>Radu</dc:creator><description>&lt;p&gt;It's annoying indeed that, when debugging a console application, the process terminates without a message (as when running without the debugger). &lt;/p&gt;
&lt;p&gt;The solution is to set a breakpoint on the last instruction in the Main method. But not once I forgot to set it and had to re-start the debugger. In my opinion it will be worth to consider it as a fix in a future update for Visual Studio.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8959037</link><pubDate>Fri, 19 Sep 2008 19:31:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8959037</guid><dc:creator>Jonathan Conley</dc:creator><description>&lt;p&gt;I agree. &amp;nbsp;I can find no logical reason for it to not stop while debugging and dose stop when not. &amp;nbsp;However when has Microsoft done any thing Logical.&lt;/p&gt;</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8959243</link><pubDate>Fri, 19 Sep 2008 21:32:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8959243</guid><dc:creator>Ricardo Villamil</dc:creator><description>&lt;p&gt;Radu, I don't think is annoying, I think is by design, otherwise how would VS know where and when to stop?&lt;/p&gt;
&lt;p&gt;I somwhat agree with Sara, that if you run in the debugger there should still be the message Press any key to continue... but when you get this msg it means the application has already exited, so what good is it to have this message in the debugger if you can't pause or examine your code (remember, the app is already finished running when you get this message). The only thing you could do is...well...hit any key to exit and go back to VS.&lt;/p&gt;
&lt;p&gt;The solution is, if you're going to use the debugger, you definitely need to have breakpoints or Debug.Stop() in your code. Leave that job to the developer, not to VS to guess where to stop/pause.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8959286</link><pubDate>Fri, 19 Sep 2008 22:10:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8959286</guid><dc:creator>Mike Ward</dc:creator><description>&lt;p&gt;I usually put the body of my main into a try/finally block. The finally block then does a check to see if it is running in the debugger and breaks if that's the case. Check out&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blueonionsoftware.com/blog.aspx?p=1e4f3e2c-c631-40a7-9176-25a677c93b0c"&gt;http://blueonionsoftware.com/blog.aspx?p=1e4f3e2c-c631-40a7-9176-25a677c93b0c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;on how to do this.&lt;/p&gt;</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8959371</link><pubDate>Fri, 19 Sep 2008 23:38:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8959371</guid><dc:creator>Eber Irigoyen</dc:creator><description>&lt;p&gt;WOOT!!... I've always added Console.Read() to my little console apps, to do just that&lt;/p&gt;
&lt;p&gt;nice... yeah, it seems backwards, but I don't care&lt;/p&gt;</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8959577</link><pubDate>Sat, 20 Sep 2008 02:42:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8959577</guid><dc:creator>Rogelio Rodriguez</dc:creator><description>&lt;p&gt;console.ReadLine()&lt;/p&gt;
&lt;p&gt;should stop the window from closing too.. just put it in your last line... before end module and end sub&lt;/p&gt;</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8960627</link><pubDate>Sun, 21 Sep 2008 21:13:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8960627</guid><dc:creator>The Danish Dynamo</dc:creator><description>&lt;p&gt;In addition to the above suggestions, you can use the Debugger.IsAttached property to conditionally wait for user input, and there are other paths e.g. directives.&lt;/p&gt;
&lt;p&gt;&amp;lt;pre&amp;gt;&lt;/p&gt;
&lt;p&gt;if (System.Diagnostics.Debugger.IsAttached) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;Press any key to continue . . .&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Console.ReadKey();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;
&lt;p&gt;Stop complaining about Microsoft products, they are better than the rest. The limitations are in your mind, the possibilities are endless.&lt;/p&gt;</description></item><item><title>re: Did you know... If you do a Ctrl+F5 on a console application, the console stays open - #317</title><link>http://blogs.msdn.com/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx#8961025</link><pubDate>Mon, 22 Sep 2008 12:38:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8961025</guid><dc:creator>X.Y.</dc:creator><description>&lt;p&gt;&amp;quot;Stop complaining about Microsoft products, they are better than the rest. The limitations are in your mind, the possibilities are endless.&amp;quot;&lt;/p&gt;
&lt;p&gt;Very funny.&lt;/p&gt;</description></item></channel></rss>