Directory.Move-> Sessions Lost

R

Ron Vecchi

I know this has been asked before but I out of all the posts I've read
regarding using Directory.Move and then the application restarting itself I
have found no answer except that Sessions are buggy or that you should
create a new folder then copy the content of the old into it and then delete
the old one...pretty lame for such a simple IO action. Can microsoft give
an answer to how to fix this or is this just a know bug... that will
hopfully be fixed in Whidbey :).

Thanks
 
S

Steven Cheng[MSFT]

Hi Ron,

From your description, you encoutered the recycling and session lost in
your web application after some certain operations. You mentioned the
"Directory.Move and IO action".
I'm not very sure on the detail of the IO Action you mentioned, would you
please provide some further description on it?

In addition, As far as I know, the following operations will cause the
ASP.NET workprocess or appdomain recycle and which will cause all the
Sessions lost:
1.Modify the machine.config file on of the server machine

2.Modify the web.config file of the application

3.Do some certain modification in the ASP.NET Webapplication's private
"bin" folder( the ASP.NET will moinitor any changes in this folder)

4.Any internal error occurs which exceed the processModel's certain
limitation. This is set in the machine.config's <processModel> element.

Please have a check to see whether the IO action have cause any of the
above things. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

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

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
R

Ron Vecchi

Sorry, but that was it.
Basically I am renaming the directory

I had a diretory called > MyDirectory

MyDirectory (contents)
Image1.jpg
Image2.jpg

Directory.Move(MyDirectoryPath, MyNewDiretoryPath)
Note: the directory was renamed fine but only all sessions were lost.

Note: The directory has nothing to do with being inside of the /bin
directory
Note: The directory has nothing to do with the web.config file.

I am aware of modifiying the above file swould result in a app restart.
Simply... I am renaming a folder and it is restarting my application.

I have noticed posts regarding this with no resolution. Are ASPNET sessions
so buggy that renaming a folder will dump all sessions?


Thanks
Ron
 
S

Steven Cheng[MSFT]

Hi Ron,

Since you mentioned that the Certain directory path have nothing to do with
the "bin" folder or the webconfig, I'd like to generate some tests on my
side. Would you please provide some further infos on your web application's
directory structure:
1. Is it in the IIS site's root folder or just a sub virtual directory
under the site root folder?

2. Where is the "MyDirectory" you mentioned and where is the
"MyNewDirectory"( you want to move to )

Also, would you please try creating a nother new web application(emtpy one
with one simple page) and try doing the same operations in it to see
whether the Session also lost in such a simple web app?

If not, we should do some further research on the certain web application.
Thanks.

Regards,

Steven Cheng
Microsoft Online Support

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

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
R

Ron Vecchi

Basicaly the website is its won website in IIS, not a virtual site or
anything

The directory struct follows:
-----------------------------

<root>
/Main/
/Globals/
/WebImages/
/FolderToBeRenamed/
--MyImage1.jpg
--MyImage2.jpg
/Services/
/bin/
web.config
default.aspx
global.asax

IIS root folder is located at C:\Inetpub\wwwroot\
The website in questions root folder is Z:\websites\mywebsite\

The Directory being renamed (Directory.MoveTo) is located at
/WebImages/FolderToBeRenamed/

Also, it only seems to drop the sesssions when renaming the folder. I tried
Moving the directory to a different directory all togeather and everything
was fine. It only happens when I attemp to rename.
I will be able to perform the test later on today and will post my results.
Thanks for all your help.
 
S

Steven Cheng[MSFT]

Hi Ron,

Thanks for the response. I've also made some tests on my side on different
machine and enviroment. It seems this is a normal behavior of the ASP.NET
runtime, it'll monitor all the folders in the application, not only the bin
folder or the web.config. As for the normal folders , the constraint is not
very strict, but seems if we rename the folders' name, it'll surely cause
the web applicaiton's appdomain restart which directly cause all the
sessions drop. I've also consulted some experts on this to confirm it. So
this is a by design behavior of the ASP.NET. How do you think so? If you
still have anything unclear, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

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

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
R

Ron Vecchi

Seems odd, i beleive you that it is by design, but why?
It seems that its only when renaming, not deleting or creating.

Odd that this is a design feature.
 
S

Steven Cheng[MSFT]

Hi Ron,

Thanks for the followup. As you mentioned that this behavior seems ood
since only renaming rather than creating or .. cause the restart of
application, in fact I also feel a bit surprised on it because I also
haven't found and doc which definitly clarify this. Also, I think there
must be some other similar internal features due to the ASP.NET's runtime
monitoring on the webapplication's folder or some other resources. Hope the
related document will be completed soon. Thanks again for your notice.

Regards,

Steven Cheng
Microsoft Online Support

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

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

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

No members online now.

Forum statistics

Threads
473,795
Messages
2,569,644
Members
45,356
Latest member
deepthi.kodakandla

Latest Threads

Top