dynamically deleteing subfolder causes ASPNET2.0 website to reset

M

msnnews.msn.com

hi there,

i've got a photo gallery that programatically creates a subfolder for each
gallery, if i delete the album in my site, it also deletes the subfolder,
but resets my website and i lose the active sessions..

please help! whats the solution to this so it doesnt reset on delete?

thanks,
Paul
 
L

Laurent Bugnion

Hi,

msnnews.msn.com said:
hi there,

i've got a photo gallery that programatically creates a subfolder for each
gallery, if i delete the album in my site, it also deletes the subfolder,
but resets my website and i lose the active sessions..

please help! whats the solution to this so it doesnt reset on delete?

thanks,
Paul

Funny, I just blogged today about that. As far as I can say, there are
no solutions...

http://geekswithblogs.net/lbugnion/archive/2006/08/21/88603.aspx

One workaround I thought of is to delete the folders only when all
sessions are terminated... That would mean keeping track of all open
sessions in the Application object, and delete the folders when the last
Session_End is fired.

HTH,
Laurent
 
J

Juan T. Llibre

re:
please help! whats the solution to this so it doesnt reset on delete?

There's no solution.

As soon as a directory is created...the application is restarted, and so are the sessions.
 
M

msnnews.msn.com

thanks for your replies..

i dont have any problems on creating the sub-directories, it only resets the
sessions when i delete the sub folders.
As for now, i have changed my code to empty the files in the folder, and add
a marker file (something like "~DELETED.txt") so i know that it has been
deleted.

thanks,
Paul
 
R

Ray Booysen

msnnews.msn.com said:
hi there,

i've got a photo gallery that programatically creates a subfolder for each
gallery, if i delete the album in my site, it also deletes the subfolder,
but resets my website and i lose the active sessions..

please help! whats the solution to this so it doesnt reset on delete?

thanks,
Paul
Keep the dirs outside the webroot?
 
G

gerry

we have been doing this in 1.1 & 2.0 and have not seen this behaviour i
think because we create/delete out temp directories in an existing directory
under the site root and not in the root itself.

ie :
siteroot/tmp/...create&delete temp folders here
siteroot/...not here
 
G

gerry

I take that back.
The reason it was never noticed was because we make no use of session data
( web service ) .
Adding a few breakpoints shows that this in fact is happening.
 
L

Laurent Bugnion

Hi,

Ray said:
Keep the dirs outside the webroot?

That's not always practical. In the case of a photoalbum, for example,
the directories with the pictures have to be under the root, because the
pictures are included using <img src="..." /> where "..." is relative to
the root.

HTH,
Laurent
 
G

gerry

I agree.
There should be a way to designate a directory under which subdirectory
creation/deletion has no impact on session or application start/stop. Maybe
an App_Tmp directory ( the way we do it ) or a web.config setting possibly
to disable this behaviour altogether.

To me this another wtf 'feature' right up there with web.config inheritance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top