Thanks for the fast reply. Yeah, I know that's what happens. However, a new
dll is also created when an aspx-page is changed. When the aspx-page is
modified, it is compiled into a new assembly that includes the modified Page
class. But instead of throwing away the AppDomain, it just loads the new
assembly in the same AppDomain. I am not exactly sure of the details, but
somehow the new assembly is then used instead of the old one. I checked
what's going on in the Temporary ASP.NET Files -directory when I modified an
aspx-page and executed it. The old version (App_Web_xxxx.dll) was renamed to
App_Web_xxxx.dll.delete and a new App_Web_yyyy.dll was created (xxxx and yyyy
seem to be just some random sequences). When I modified a class file in the
App_Code directory, new versions of both App_Web.dll and App_Code.dll were
created. The difference was that the old versions weren't renamed to .delete.
I still don't understand why the code in the App_Code directory can't be
handled in the same way as the code in aspx-pages. Couldn't the dll renaming
and other stuff be done in the same way as with aspx-pages? I know the old
versions can't be unloaded (at least in ASP1.1) so they consume some memory,
but it's the same with the compiled aspx-pages and I think it's the lesser of
two evils.
"Curt_C [MVP]" wrote:
IIRC it's because these files need to be recompiled into the site DLL(s)
which means that the app is restarted.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"jake" wrote:
I've seen many articles that claim the files in the App_Code directory are
treated in the same way as aspx-files in ASP 1.1. Well, this does not seem to
be the case, at least in Web Developer 2005 Express Beta2. If I change
anything in any of the class files residing in App_Code, the AppDomain is
unloaded and all application data, including all sessions, is lost. Is there
anything I can do to prevent this?
This undesired side-effect means that I still cannot make any changes in a
critical production site without informing the customer in advance and
running the service down at a predefined time. Aspx-files are still the only
files that can be modified at runtime without unloading the AppDomain.
Why can't the new assembly be loaded in the current AppDomain? And is this
going to change for the final release or is the feature by design?