session problem

  • Thread starter Thread starter James Wong
  • Start date Start date
J

James Wong

Hi,

After I use the function "Directory.Delete" or "Directory.Move", my session
will destory.
Why? Thanks.

James
 
That's well-known behavior.
The AppDomain is restarted when the Application's directory structure changes.

It only happens when you use InProc session state management,
I think, but not with other session state management modes.

You can work around it by iterating through the files in the directory,
and deleting just the files, but not deleting the directory.

You may want to store the directory names and do multiple directory
deletions at your application's slowest time ( maybe even setup a Windows
service to do this for you at the time you prefer for the operation ).



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
This path:
"C:\Documents and Settings\james\My Documents\Visual Studio
2005\Projects\FileManagement\UserFolder"

James


Eliyahu Goldin said:
What directory you are deleting?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


James Wong said:
Hi,

After I use the function "Directory.Delete" or "Directory.Move", my
session will destory.
Why? Thanks.

James
 
Back
Top