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?