Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 3.5 and Visual Studio. 2008 > Visual Studio 2008
|
Visual Studio 2008 For discussing Visual Studio 2008. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2008 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2010, 01:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Infinite loops require VS IDE restart?

I have been trying to debug an infinite loop in a VB.NET ASP application. It's a PITA to find and I have been forced to stop and restart execution numerous times to insert additional debugging statements to isolate the cause.

I'd have expected clicking the "Stop Debugging" button in the VS IDE to either kill the execution thread or recycle the copy of IIS it uses when execution is stopped, but that's not what I am seeing. Instead, a restarted program containing an infinite loop appears to CONTINUE running from the point where it was killed. So after restart, I appear to have two instances of code running in the IDE, the original infinite loop I killed, and a new one from the restart. This results in even slower performance because it's now iterating two infinite loops. And it's not possible to tell which iteration is hitting breakpoints and debugging statements because both iterations are running at the same time but are at different points in the code. Kill it and restart it again and now there are three instances.

The only way I have found to really kill an existing IIS process is to restart the VS IDE, time consuming and tedious after numerous restarts. Is there and option hidden somewhere in VS to recycle the IIS server so it is not necessary to restart VS every time this happens?
 
Old June 9th, 2010, 02:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there..

You are using the build in IIS?? (I don´t remember it name).. What if you kill it after you hit stop (it's not stopped by default)...
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old June 9th, 2010, 02:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

OK, but how?
 
Old June 9th, 2010, 02:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You could try recycling the IIS Application Pool:

1. Start IIS Manager (inetmgr)

2. Expand until you see Application Pools

3. Find your pool, right-click it and choose Recycle.

Maybe that helps.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old June 9th, 2010, 04:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Hi Imar! Thanks for the suggestion. I actually found and fixed the loop while awaiting an answer, but reintroduced the bug to test your suggestion.

Alas, the code continues to run despite both recycling and manually stopping/starting all available pools. Cycling the service works, but that's as painful as restarting VS.

It looks like the best answer is to avoid coding infinite loops!
 
Old June 10th, 2010, 02:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
It looks like the best answer is to avoid coding infinite loops!
Sounds like solid advice.... ;-)

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
infinite loop smilesmita Pro PHP 1 December 21st, 2007 10:44 AM
break for-each loops, or limit amount of loops warhero XSLT 2 July 4th, 2007 02:18 AM
infinite recursion bangbangbogi XSLT 3 May 4th, 2006 05:54 AM
While loops and For loops in XSLT spencer.clark XSLT 1 August 5th, 2005 09:50 AM
Infinite timer? acdsky VBScript 1 June 17th, 2004 02:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.