473,508 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application restarts when deleting a directory

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/micros...016a2bf4ce505d

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
Nov 19 '05 #1
6 4542
Forgot to mention: I'm using Visual Studio 2005 / ASP.NET 2.0.

"Martin Bischoff" wrote:
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/micros...016a2bf4ce505d

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

Nov 19 '05 #2
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.

"Martin Bischoff" <ni******@newsgroup.nospam> wrote in message
news:9A**********************************@microsof t.com...
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/micros...016a2bf4ce505d

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

Nov 19 '05 #3
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.

"Martin Bischoff" <ni******@newsgroup.nospam> wrote in message
news:9A**********************************@microsof t.com...
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/micros...016a2bf4ce505d

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


Nov 19 '05 #4
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?= <ni******@newsgroup.nospam>
| References: <9A**********************************@microsoft.co m>
<Oq**************@TK2MSFTNGP09.phx.gbl>
| Subject: Re: Application restarts when deleting a directory
| Date: Fri, 11 Nov 2005 08:35:05 -0800
| Lines: 35
| Message-ID: <F1**********************************@microsoft.co m>
| 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!TK2MSFT NGXA03.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.
| >
| > "Martin Bischoff" <ni******@newsgroup.nospam> wrote in message
| > news:9A**********************************@microsof t.com...
| > > 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/micros...k.aspnet/brows
e_frm/thread/56e6eaafbc6a88c9/a1016a2bf4ce505d?lnk=st&q=delete+directory+ses
sion+group:*.aspnet.*&rnum=9&hl=de#a1016a2bf4ce505 d
| > >
| > > 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
| >
| >
| >
|

Nov 19 '05 #5
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?= <ni******@newsgroup.nospam>
| References: <9A**********************************@microsoft.co m>
<Oq**************@TK2MSFTNGP09.phx.gbl>
| Subject: Re: Application restarts when deleting a directory
| Date: Fri, 11 Nov 2005 08:35:05 -0800
| Lines: 35
| Message-ID: <F1**********************************@microsoft.co m>
| 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!TK2MSFT NGXA03.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.
| >
| > "Martin Bischoff" <ni******@newsgroup.nospam> wrote in message
| > news:9A**********************************@microsof t.com...
| > > 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/micros...k.aspnet/brows
e_frm/thread/56e6eaafbc6a88c9/a1016a2bf4ce505d?lnk=st&q=delete+directory+ses
sion+group:*.aspnet.*&rnum=9&hl=de#a1016a2bf4ce505 d
| > >
| > > 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
| >
| >
| >
|

Nov 19 '05 #6
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?= <ni******@newsgroup.nospam>
| References: <9A**********************************@microsoft.co m>
<Oq**************@TK2MSFTNGP09.phx.gbl>
<F1**********************************@microsoft.co m>
<cI**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: Application restarts when deleting a directory
| Date: Mon, 14 Nov 2005 02:32:02 -0800
| Lines: 116
| Message-ID: <17**********************************@microsoft.co m>
| 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?= <ni******@newsgroup.nospam>
| > | References: <9A**********************************@microsoft.co m>
| > <Oq**************@TK2MSFTNGP09.phx.gbl>
| > | Subject: Re: Application restarts when deleting a directory
| > | Date: Fri, 11 Nov 2005 08:35:05 -0800
| > | Lines: 35
| > | Message-ID: <F1**********************************@microsoft.co m>
| > | 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!TK2MSFT NGXA03.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.
| > | >
| > | > "Martin Bischoff" <ni******@newsgroup.nospam> wrote in message
| > | > news:9A**********************************@microsof t.com...
| > | > > 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/micros...k.aspnet/brows
| >
e_frm/thread/56e6eaafbc6a88c9/a1016a2bf4ce505d?lnk=st&q=delete+directory+ses
| > sion+group:*.aspnet.*&rnum=9&hl=de#a1016a2bf4ce505 d
| > | > >
| > | > > 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
| > | >
| > | >
| > | >
| > |
| >
| >
|

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4440
by: MisterG | last post by:
Hi, In my code, I rename a folder and then the asp.net application restarts ! So i've lost my session variables ... How is it possible for the application asp.net to restart when you rename a...
4
2483
by: Jack Wright | last post by:
Dear All, Every Virtual directory under IIS is executed in a new AppDomain. This is done by CLR itself. When I deploy a dll under its bin, the AppDomain is restarted as a result all my dlls under...
20
4415
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
1
1771
by: n_o_s_p_a__m | last post by:
I have a method call in my static constructor which initializes 2 variables. I need to know when the static constructor (after the first call) will be called. Does unloading the virtual directory...
3
1887
by: amolkasbekar | last post by:
Hi All, I have a asp.net application that I am migrating from 1.1 to 2.0. The App runs fine in 1.1. My setup is Winxp with IIS5. However, when I run the app in 2.0, IIS is doing an 'Application...
3
2139
by: Ray Booysen | last post by:
In our application, we merge documents for our clients. The directory structure is as follows: webroot ->bin ->Documents ->Company -> Company X
1
2626
by: Brian Simmons | last post by:
Hi All, I know that if you modify the web.config file or any file in the App_Code subfolder, that ASP.net 2.0 will "restart" the application (i.e. clear out any sessions, etc...). Are there...
5
2617
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application....
0
1124
by: Juan T. Llibre | last post by:
Here's the updated list of file changes which trigger Aplication restarts : 1. Adding, modifying, or deleting any source code file in any application folder ( *.cs, *.vb, etc. ) 2. Adding,...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.