Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > aspnet_wp.exe has handle on directory being deleted

Thread Tools

aspnet_wp.exe has handle on directory being deleted

Chris McFarling
Posts: n/a
I have a basic aspx page for the user to select the month & year. They then
click a button to generate a report. The following sequence happens:

- Temp directory is created (if it exists already, it is deleted first)
- A simple aspx file is built in code and written to the temp directory with
a StreamWriter
- A View Report button is displayed for the user

The View Report button is a HyperLink control that targets a blank window.
When clicked the temp aspx file in the temp directory is displayed in the

Once the temp aspx file is accessed, if the user tries to run the report
again, an error is thrown. It appears that aspnet_wp.exe has a handle on the
temp directory which interferes with the following code:

If Directory.Exists(strPath) = True Then
Directory.Delete(strPath, True)
End If
dsDataSet.WriteXml(strPath & "\report.xml")

The error only occurs the first time the report is run after viewing the
file. The error is caused by the WriteXml command not having a directory to
write to. So the directory gets deleted but it does not get recreated.
Re-running the report again at that poit is successfull.

Here's a summary of how to recreate the error:

Run report = success
Don't view file
Re-run report = success
View file
Re-run report = failure
Re-run report = success

This appears to be an issue where aspnet_wp.exe has a handle on a
file/directory that is part of the web application. Is there a way to keep
hat from happening?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
axis attachment apache temp directory solaris being deleted Java 0 03-26-2010 03:18 PM
Re: Are deleted pictures REALLY deleted? Computer Support 3 01-01-2009 08:53 AM
Re: Are deleted pictures REALLY deleted? John Holmes Computer Support 7 12-31-2008 04:46 PM
Re: Are deleted pictures REALLY deleted? Bucky Breeder Computer Support 0 12-31-2008 02:58 PM
Record not being deleted in dbase, even tho the display on datagrid is deleted.. Chumley the Walrus ASP .Net Web Controls 2 08-10-2004 02:23 PM