
232
|
Chapter 11: ASP.NET Deployment
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Deploying Application-Specific Assemblies
As noted in the preceding section, deploying application-specific assemblies is as
simple as deploying other application files. As long as the assemblies reside in the
bin subdirectory of the application, no further action is required on the part of the
developer apart from copying the application’s files to the target server.
The magic of the bin directory is enabled by the
<assemblies> configuration
element in machine.config, which contains the following
<add> element by default:
<add assembly="*" />
This element tells the ASP.NET runtime to load any assemblies residing in the bin
subdirectory for use by the application.
Another important point is that when assemblies are loaded by the ASP.NET
runtime, the actual physical DLL containing the assembly is never loaded into
memory. Instead, the ASP.NET runtime makes a shadow copy of the DLL and
loads and locks it on the disk instead (while setting up a file monitor on the orig-
inal DLL file). This means that you can update the .NET assemblies associated
with your application at any time, without the need to shut down IIS or restart the
server. The ASP.NET runtime automatically detects when an assembly is updated
and serves all new requests using the new version