By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,666 Members | 1,909 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,666 IT Pros & Developers. It's quick & easy.

Ending all processes when application closes.

P: n/a
I have built an asp.net application that runs in explorer
and does a bunch of screen scraping and posting to
various websites using httpWebRequest and
httpWebResponse. My application loops through various
URLs, performing various jobs on specified websites.
When I break the application in debug mode, all
associated processes stop accordingly. I have set the
Debugging Option to stop all process when a break is
hit. However, when I end the application in the midst of
debugging, some errant process continues to loop through
my URLS and continue to perform screen scraping
operations, even though the debugging session is no
longer running and explorer has closed. The only way to
stop the process is to kill aspnet_wp.exe, or to manually
restart IIS. Any ideas of what is going on?
Nov 17 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Hi David,

What did you mean "screen scraping " process, and how did you start the
httpWebRequest, with threads?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #2

P: n/a
Hi,

if you are using threads ensure to set thier IsBackground property to
true. if you are using system.diagnostics.Process to start a process
Kill all the process before you exit your code.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3

P: n/a
I actually have two separate applications. In one application I spawn
thread to perform the WebRequests. That application exhibits the
behavior I mentioned previously. However in another application I
wrote, I make the WebRequest WITHOUT spawning threads. This application
also shows the same behavior.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #4

P: n/a
I'm not using either of the thread processing approaches mentioned in
the application that doesn't use any threading.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #5

P: n/a
Hi David,

As you mentioned, "some errant process continues to loop through my URLS
and continue to perform screen scraping" are these processes started by
system.diagnostics.Process, or threads, or objects created in your asp.net
application?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #6

P: n/a
A button on my aspx page runs the following code:

Private Sub btnRespond_Click(...

Dim Response As String
Dim Brd As New clsPost(...
Response = Brd.AutoRespondToInvHits()
...
...
End Sub

clsPost is a class from a separate class library project.

The code running in the method:
Brd.AutoRespondToInvHits()
is the code that continues to run after a debugging session has ended.
There is NOT any 'process' or 'thread' or 'async' code in this method or
in any of the methods called by this method.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #7

P: n/a
From the code, the object "clsPost" wasn't released. It may be waiting for
response from the web site. You may manullay dispose these objects
somewhere, for exaplme, in session timeout.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #8

P: n/a
How exactly do I trigger a dispose method when ending a debugging
session? And why do you think the session class doesn't get released
when I end debugging in the first place? It not only continues to run,
but it will loop through code continuing to make new requests to other
web pages even after I have ended debugging. It doesn't end until the
code has looped through all the web pages that it would have looped
through if I had never ended the debugging session. I'm running Windows
XP Prof and .NET 1.1 with VS 2003 if that helps you any.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #9

P: n/a


How exactly can I trigger a dispose method when I end a debugging
session?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #10

P: n/a
Hi David,

In you code:

Dim Brd As New clsPost(...
Response = Brd.AutoRespondToInvHits()

The new clsPost object was created and I haven't seen you released it. It
may continue to run if the program exist in abnormal way, for example,
terminate the debug session. You may refer to this article for more
information:

http://msdn.microsoft.com/library/de...us/vbcn7/html/
vaconFinalizeDestructors.asp

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #11

P: n/a


I just tried the link you gave me and got the following message:
"Directory Listing Denied
This Virtual Directory does not allow contents to be listed."

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #12

P: n/a
Hi David,

Did you browse a broken link like:

http://msdn.microsoft.com/library/de...us/vbcn7/html/

The complete link is:

http://msdn.microsoft.com/library/de...us/vbcn7/html/
vaconFinalizeDestructors.asp

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #13

P: n/a
Hi David,

If you need a more prompt assistance on this issue,. I suggest you submit a
service request for this issue.The instructions is listed at:

http://support.microsoft.com/default...EN-US;CNTACTMS

Hope them help.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.