Application restarts when deleting a directory

G

Guest

Hi,

I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123)
to allow users to upload files. When I later delete these directories (from
the code behind), the application restarts and all active sessions are
terminated.

This error is also described in detail here:
http://groups.google.ch/group/micro...roup:*.aspnet.*&rnum=9&hl=de#a1016a2bf4ce505d

What can be done to prevent the web application from restarting when
temporary directories are deleted? Which directories are watched for changes
by ASPNET?

Thanks for any help,
Martin
 
W

William LaMartin

One thought: Perhaps you have some antivirus or such software running on the
server which kicks in when you do the rename. I recall that such software
can cause the session information to be lost.
 
G

Guest

Thanks for your reply. The problem also occurs on a server without antivirus
software.

Martin
 
S

Steven Cheng[MSFT]

Hi Martin,

I think the problem you're meeting is the expected behavior. The ASP.NET
runtime will constantly monitor the Application Root foder and its sub
dirs, and any changes such as deleting or renaming on folders will cause
the AppDomain being restarted... So programmatically change ASP.NET
applicaiton's app folder structure is not a good idea (that's also why the
ASP.NET runtime don't put any dynamic changable folders assosicated with
each application(such as shadow copy , dynamic compilation or serliaztion
temp assemblies folder...) in the applicaiton's own dir....
It is recommended wo make those folders outside in external directories...
Or just define some unremovable folders under application root dir , but
just clearing all the files in it each time wo need to do clear up task...

Thanks,

Steven Cheng
Microsoft Online Support

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


--------------------
| Thread-Topic: Application restarts when deleting a directory
| thread-index: AcXm3d8ppfDL8SdoSrOHJ29bEwKl7Q==
| X-WBNR-Posting-Host: 194.209.202.1
| From: =?Utf-8?B?TWFydGluIEJpc2Nob2Zm?= <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Application restarts when deleting a directory
| Date: Fri, 11 Nov 2005 08:35:05 -0800
| Lines: 35
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:357412
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for your reply. The problem also occurs on a server without
antivirus
| software.
|
| Martin
|
| "William LaMartin" wrote:
|
| > One thought: Perhaps you have some antivirus or such software running
on the
| > server which kicks in when you do the rename. I recall that such
software
| > can cause the session information to be lost.
| >
| > | > > Hi,
| > >
| > > I'm creating temporary directories in my web app (e.g.
| > > ~/data/temp/temp123)
| > > to allow users to upload files. When I later delete these directories
| > > (from
| > > the code behind), the application restarts and all active sessions are
| > > terminated.
| > >
| > > This error is also described in detail here:
| > >
http://groups.google.ch/group/microsoft.public.dotnet.framework.aspnet/brows
e_frm/thread/56e6eaafbc6a88c9/a1016a2bf4ce505d?lnk=st&q=delete+directory+ses
sion+group:*.aspnet.*&rnum=9&hl=de#a1016a2bf4ce505d
| > >
| > > What can be done to prevent the web application from restarting when
| > > temporary directories are deleted? Which directories are watched for
| > > changes
| > > by ASPNET?
| > >
| > > Thanks for any help,
| > > Martin
| >
| >
| >
|
 
G

Guest

Hi Steven,
thanks for your answer, that explains the behavior. The bad thing is, that
this behavior changed since .NET 1.1, where our solution used to work.

Do you have any tips/ideas how an application with the following
functionality could be migrated to ASP.NET 2.0:
- we have stored lots of pages (ASPX) in a database, e.g. sort of a catalog.
- these pages are created/modified using an external application (windows
client).
- the pages are written to the web app (into sub-folders per item, e.g.
~/data/catalog/itemXY/default.aspx). This is currently done in a timer
(started in global.asax / Application_OnStart) which polls the DB for changes.
- when an item is deleted from the database, the corresponding folder and
files should also be deleted from the web app.

Thanks for any help.
Best regards,
Martin Bischoff
 
S

Steven Cheng[MSFT]

Thanks for your respone Martin,

Well, I've got your detailed scenario after your further description. Seems
your current implementation which dynamically modify directory structure
has violate the ASPNET runtime directory monitoring.... .
I'm afraid we haven't any means to turn off such restarting caused by the
directory structure change. As far as I know, what we can do is configure
the max num of aspx page's dynamic recompilation time( prevent appdomain
from restarting when the aspx files being recompile exceed the max number
...). However, for change directory strucure (dynamically add or
remove...), we can not prevent it from being restarted...

Thanks,

Steven Cheng
Microsoft Online Support

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


--------------------
| Thread-Topic: Application restarts when deleting a directory
| thread-index: AcXpBqZHY13niANAREOt8KujeyaNGQ==
| X-WBNR-Posting-Host: 194.209.202.1
| From: =?Utf-8?B?TWFydGluIEJpc2Nob2Zm?= <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Application restarts when deleting a directory
| Date: Mon, 14 Nov 2005 02:32:02 -0800
| Lines: 116
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:357876
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi Steven,
| thanks for your answer, that explains the behavior. The bad thing is,
that
| this behavior changed since .NET 1.1, where our solution used to work.
|
| Do you have any tips/ideas how an application with the following
| functionality could be migrated to ASP.NET 2.0:
| - we have stored lots of pages (ASPX) in a database, e.g. sort of a
catalog.
| - these pages are created/modified using an external application (windows
| client).
| - the pages are written to the web app (into sub-folders per item, e.g.
| ~/data/catalog/itemXY/default.aspx). This is currently done in a timer
| (started in global.asax / Application_OnStart) which polls the DB for
changes.
| - when an item is deleted from the database, the corresponding folder and
| files should also be deleted from the web app.
|
| Thanks for any help.
| Best regards,
| Martin Bischoff
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Martin,
| >
| > I think the problem you're meeting is the expected behavior. The
ASP.NET
| > runtime will constantly monitor the Application Root foder and its sub
| > dirs, and any changes such as deleting or renaming on folders will
cause
| > the AppDomain being restarted... So programmatically change ASP.NET
| > applicaiton's app folder structure is not a good idea (that's also why
the
| > ASP.NET runtime don't put any dynamic changable folders assosicated
with
| > each application(such as shadow copy , dynamic compilation or
serliaztion
| > temp assemblies folder...) in the applicaiton's own dir....
| > It is recommended wo make those folders outside in external
directories...
| > Or just define some unremovable folders under application root dir ,
but
| > just clearing all the files in it each time wo need to do clear up
task...
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | Thread-Topic: Application restarts when deleting a directory
| > | thread-index: AcXm3d8ppfDL8SdoSrOHJ29bEwKl7Q==
| > | X-WBNR-Posting-Host: 194.209.202.1
| > | From: =?Utf-8?B?TWFydGluIEJpc2Nob2Zm?= <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Application restarts when deleting a directory
| > | Date: Fri, 11 Nov 2005 08:35:05 -0800
| > | Lines: 35
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:357412
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Thanks for your reply. The problem also occurs on a server without
| > antivirus
| > | software.
| > |
| > | Martin
| > |
| > | "William LaMartin" wrote:
| > |
| > | > One thought: Perhaps you have some antivirus or such software
running
| > on the
| > | > server which kicks in when you do the rename. I recall that such
| > software
| > | > can cause the session information to be lost.
| > | >
| > | > | > | > > Hi,
| > | > >
| > | > > I'm creating temporary directories in my web app (e.g.
| > | > > ~/data/temp/temp123)
| > | > > to allow users to upload files. When I later delete these
directories
| > | > > (from
| > | > > the code behind), the application restarts and all active
sessions are
| > | > > terminated.
| > | > >
| > | > > This error is also described in detail here:
| > | > >
| >
http://groups.google.ch/group/microsoft.public.dotnet.framework.aspnet/brows
| >
e_frm/thread/56e6eaafbc6a88c9/a1016a2bf4ce505d?lnk=st&q=delete+directory+ses
| > sion+group:*.aspnet.*&rnum=9&hl=de#a1016a2bf4ce505d
| > | > >
| > | > > What can be done to prevent the web application from restarting
when
| > | > > temporary directories are deleted? Which directories are watched
for
| > | > > changes
| > | > > by ASPNET?
| > | > >
| > | > > Thanks for any help,
| > | > > Martin
| > | >
| > | >
| > | >
| > |
| >
| >
|
 

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

Top