473,473 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How does ASP.NET check for changes to aspx files ?

I would like to understand how ASP.NET 1.1 detects changes to aspx files and
then forces an unload of the application domain (forcing a recompilation) -
can anyone give me a clue as to where I can start looking ?

Joseph Farmer
Nov 19 '05 #1
5 1251
ASP.NET uses FileSystemWatcher to detect changes to system files:

http://msdn.microsoft.com/library/de...classtopic.asp

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Joseph Farmer" <jo**@asdasd.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
I would like to understand how ASP.NET 1.1 detects changes to aspx files and then forces
an unload of the application domain (forcing a recompilation) - can anyone give me a clue
as to where I can start looking ?

Joseph Farmer

Nov 19 '05 #2
Juan,

Ok, thanks - so once it detects that a file has changed how does it force
the application domain to be unloaded ?

Joseph

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:e1**************@tk2msftngp13.phx.gbl...
ASP.NET uses FileSystemWatcher to detect changes to system files:

http://msdn.microsoft.com/library/de...classtopic.asp

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Joseph Farmer" <jo**@asdasd.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
I would like to understand how ASP.NET 1.1 detects changes to aspx files
and then forces an unload of the application domain (forcing a
recompilation) - can anyone give me a clue as to where I can start looking
?

Joseph Farmer


Nov 19 '05 #3
Hi Joe:

The appdomain is not necessarily restarted, but there is a setting
called numRecompilesBeforeApprestart in the <compilation> section of
machine.config. Once the # of dynamic compiles exceeds this number
(the default is 15) the app domain will restart.

There are Load and Unload methods on the System.AppDomain class if you
want to experiment with AppDomains yourself.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 1 Jun 2005 16:01:27 +0100, "Joseph Farmer" <jo**@asdasd.com>
wrote:
Juan,

Ok, thanks - so once it detects that a file has changed how does it force
the application domain to be unloaded ?

Joseph

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:e1**************@tk2msftngp13.phx.gbl...
ASP.NET uses FileSystemWatcher to detect changes to system files:

http://msdn.microsoft.com/library/de...classtopic.asp

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Joseph Farmer" <jo**@asdasd.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
I would like to understand how ASP.NET 1.1 detects changes to aspx files
and then forces an unload of the application domain (forcing a
recompilation) - can anyone give me a clue as to where I can start looking
?

Joseph Farmer



Nov 19 '05 #4
Scott,

The problem with trying to unload the AppDomain using AppDomain.Unload is
that any code in the website which tries to do this will fail because it is
trying to unload itself. This is why I was trying to grasp how ASP.NET does
it - in case there is some other solution which I can hook into which means
I don't write code which tries to unload itself. Hope this is clear.

Joseph

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:lg********************************@4ax.com...
Hi Joe:

The appdomain is not necessarily restarted, but there is a setting
called numRecompilesBeforeApprestart in the <compilation> section of
machine.config. Once the # of dynamic compiles exceeds this number
(the default is 15) the app domain will restart.

There are Load and Unload methods on the System.AppDomain class if you
want to experiment with AppDomains yourself.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 1 Jun 2005 16:01:27 +0100, "Joseph Farmer" <jo**@asdasd.com>
wrote:
Juan,

Ok, thanks - so once it detects that a file has changed how does it force
the application domain to be unloaded ?

Joseph

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:e1**************@tk2msftngp13.phx.gbl...
ASP.NET uses FileSystemWatcher to detect changes to system files:

http://msdn.microsoft.com/library/de...classtopic.asp

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Joseph Farmer" <jo**@asdasd.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
I would like to understand how ASP.NET 1.1 detects changes to aspx files
and then forces an unload of the application domain (forcing a
recompilation) - can anyone give me a clue as to where I can start
looking
?

Joseph Farmer

Nov 19 '05 #5
Hi Joeseph:

The general approach is to work with 2 AppDomains - a "main" AppDomain
that loads and kicks off execution in a second "worker" domain that
can be unloaded when needed. This is essetially what ASP.NET is doing.

You can see some of this architecture outside of ASP.NET if you google
around for .NET plugin patterns. Many people write plugins to work in
a seperate AppDomain so that the plugin can be unloaded (individual
assemblies cannot be unloaded, so this is the only way to get a plugin
out of memory and unlock dlls).

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 1 Jun 2005 23:03:15 +0100, "Joseph Farmer" <jo**@asdasd.com>
wrote:
Scott,

The problem with trying to unload the AppDomain using AppDomain.Unload is
that any code in the website which tries to do this will fail because it is
trying to unload itself. This is why I was trying to grasp how ASP.NET does
it - in case there is some other solution which I can hook into which means
I don't write code which tries to unload itself. Hope this is clear.

Joseph

"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:lg********************************@4ax.com.. .
Hi Joe:

The appdomain is not necessarily restarted, but there is a setting
called numRecompilesBeforeApprestart in the <compilation> section of
machine.config. Once the # of dynamic compiles exceeds this number
(the default is 15) the app domain will restart.

There are Load and Unload methods on the System.AppDomain class if you
want to experiment with AppDomains yourself.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 1 Jun 2005 16:01:27 +0100, "Joseph Farmer" <jo**@asdasd.com>
wrote:
Juan,

Ok, thanks - so once it detects that a file has changed how does it force
the application domain to be unloaded ?

Joseph

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:e1**************@tk2msftngp13.phx.gbl...
ASP.NET uses FileSystemWatcher to detect changes to system files:

http://msdn.microsoft.com/library/de...classtopic.asp

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Joseph Farmer" <jo**@asdasd.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
>I would like to understand how ASP.NET 1.1 detects changes to aspx files
>and then forces an unload of the application domain (forcing a
>recompilation) - can anyone give me a clue as to where I can start
>looking
>?
>
> Joseph Farmer
>


Nov 19 '05 #6

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

Similar topics

1
by: kbailey | last post by:
what a waste of money. visual studio does not handle user control files - these are files with and ascx extension are are refered to in the help as 'user-authored server controls'. the VS...
4
by: kimpton | last post by:
Hi, My App running on my local machine is trying to access apsx and ascx pages via a virtual directory (see earlier post) that points to a share on a different machine. I can now access .aspx...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
3
by: wwwmike | last post by:
For some reasons my HTTP Redirect for 404 errors does not work for certain files like .gif .jpg on IIS Version: 5.1, but it works perfectly with the VisualStudio2005 internal webserver ...
3
by: needin4mation | last post by:
Hi, I was trying to update some 1.1 code with 2005. I ran into problems, so I thought I'd just use notepad to make a minor change to the .cs file. When I run the .aspx file (and refresh), nothing...
2
by: Max2006 | last post by:
Hi, After I right-click on my web application project file and choose "Publish ." and do the publishing, the result publishable files does not include the *.ashx files. Is it by design? How...
8
by: Matthew Wells | last post by:
Hello, I'm working on an ASP.net 2.0 web project using VS 2005. I'm on my laptop running IIS on WinXP SP2 with all the latest updates. The Default web site is set to run on .net 2.0 My...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration:...
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
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,...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.