473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Ending all processes when application closes.

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
13 1454
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
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
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
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
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
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
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
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


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
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


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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Darrin J Olson | last post by:
I am trying to end a session for a site without having to completely close the browser to end it. When I access the site and log in it works fine. If I log out and in with a different account...
22
by: Jim Hubbard | last post by:
I am reposting a portion of a thread that I am involved in under a new topic because it seems that there are still people that believe the whole "DLL Hell" myth. I hope I can shed some light on...
27
by: cj | last post by:
I run this program and to exit click the X in the upper right corner. But apparently it isn't really ending the program. If I return to VB and make changes then try to rebuild the app it says the...
8
by: Christian Blackburn | last post by:
Hi Gang, I would like to have my application retain sessions even after the user closes their browser window, up unil the time the session is supposed to time out. Right now if the user closes...
8
by: mandydhaliwal | last post by:
Hi all, I am porting a win32 c++ program on Linux which first reads a list of processes and their paths from a file.Then this program should launch all of thesese processes. I tried to...
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
4
by: JamesB | last post by:
Hi, I need to trap a particular process starting or ending. I have done this using process.start from within my own app, but powers that be really want it to be seperate (i.e. my app should...
14
by: John | last post by:
Hi I have a winform app. When this app is closed it remains under 'Processes' in Task Manager. What is the problem and how can I ensure that app closes completely and releases all resources? ...
2
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have a VB 2008 program, AutoBackup3, converted from VB 6, to back up my files, using Migo Backup Pro, & to do several manipulations with the resulting backup files. Migo Backup Pro is called...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.