|
xxx
Xcopy Deployment and
Web.Config Overview by Charles Carroll
Whenever you transferred a website to a new
machine in Classic ASP there would be components to register, metabase/server
settings to transfer and much more. In ASP.net merely xcopying is sufficient
since components register themselves dynamically and all configuration is in
web.config files which are simple ASCII XML files.
global.asax
is a replacement for global.asa and offers 14 events that let you participate in
the whole request cycle. see:
http://aspng.com/quickstart/aspplus/doc/globalasax.aspx
A config.web is a replacement for
- the metabase
- MMC settings
- INI files (you can place custom data there)
- Windows registry
- ACLs
- can even participate in HTTPhandlers (a much
more elegant version of ISAPI filters, see:
http://aspng.com/quickstart/aspplus/doc/httphandlers.aspx
- can make behavioral changes to all .aspx files
loaded into memory without touching each page
http://www.aspnextgen.com/tutorials.aspx?tutorialid=60
explains about config.web as well.
Since it is merely an ASCII/XML file once you
copy a site the site works without reliance on the older mechanisms above. The
site "just works" as all deployment info is in the config.web
Maybe a few samples will make the point.
Sample #1: Web Garden support
You have a web-garden (multiple CPUs in one computer)
A simple config.web settings allows all CPUs to participate in ASP.net
processing instead of just one CPU. see:
http://www.aspfree.com/asp+/webgarden.aspx
Sample #2: Trace/Debug
You want to do post-mortem tracing (that is see all requests on your webserver)
A simple config.web setting allows you to turn on a log of all pages executed,
millisecond timing, client info, etc. see:
http://www.aspng.com/learn/debug1.aspx
Sample #3: Custom Data
You can place connection strings or
custom data and fetch it.
http://www.aspfree.com/asp+/demos/connstring.aspx
Sample #4: Session Data Customization
Sessions state persisted to database, cookieless sessions, etc.
are setup here.
http://aspng.com/quickstart/aspplus/doc/stateoverview.aspx
has details.
Sample #5: Pre-load libraries
<assemblies>
<add assembly="mscorlib"/>
<add assembly="System.Web.Services"/>
<add assembly="System.Xml"/>
<add assembly="System.Xml.Serialization"/>
</assemblies>
would guarantee all pages had access to the assemblies (the .net improved DLLs)
without page level commands.
Sample #6: Authenticate Requests
Any pages can be protected by passwords/logins without page level changes. Just
a config.web settings:
http://aspng.com/quickstart/aspplus/doc/authandauth.aspx
Sample #7: ASP.net crash proofing
see:
http://www.aspng.com/learn/crashproof.aspx
Of course these samples are "just the tip of
the iceberg" as Scott Guthrie would say.
|