Professional in ASP.NET 2005

1:Application Updates
    One of the most remarkable features about the ASP.NET execution model is that you can update
your web application without needing to restart the web server and without worrying about harming
existing clients. This means you can add, replace, or delete files in the virtual directory at any
time. ASP.NET then performs the same transition to a new application domain that it performs
when you modify the web.config configuration file
    Being able to update any part of an application an any time .without interrupting existing requests,is a powerful feature.However,it's very important to understand the architecture taht makes it possible.Many developer make the mistake of assumping that it's feature of the CLR that allows ASP.NET to seamlessly  transition to a new application domain.But in reality ,The CLR always locks assembly files when it executes them .To get around this limitation, ASp.NET doesn't actually use the ASP.NET files in the virtual directory,Instead ,it uses anthoer technique ,Called shadow copy ,during the compilcation process to create a copy of your files in c:\[WinDir]\Microsoft.NET\[Version]\Temporary ASP.NET Files. The worker process loads the assemblies from this directory,which means these assemblies are locked.
    The second part of this story is asp.net 's ability to detect when you change the original files.The system to track directories and files and send immediate change notifications.ASP.NET maintains an active list of all assemblies loaded within a particular application's domain and uses monitoring code to watch for changes and acts accordingly

posted @ 2008-03-21 21:34  陋室  阅读(135)  评论(0编辑  收藏  举报