473,416 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

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 4534
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.