Some notes on: ASP.NET Web Applications (APress 2008)

In no particular order:

  • Application domains are delimited by Virtual Directories.
    • Changing the web.config or replacing a .aspx or .dll recycles the application domain.
    • Machine config settings can determine application domain recycling based on performance parameters (queued requests/memory usage etc)
    • Shadow copy means that the CLR dll lock is placed on a copy of the dll under the win folder – means requests are fulfilled before recycling, and a new application domain is seamlessly created for new requests (thou session is lost).
  • Global.asax is an example of code using the global Application object – ASP.NET creates a pool of Application objects when a app domain is created. Each request is allocated one of these objects. For this reason any member variables should always be static (i.e shared).
  • Application events can be accesses in the global.asax – Authenticate and Authorize are useful for bespoke user auth logic.
  • ASP.NET Configuration is based on “cascading” xml config files – startng with the machine.config and root web.config in the win .NET folder. 
  • machine.config also holds the machineKey setting for data encryption (viewstate and forms auth cookie webfarm encryption issues, p.177) – example code to create a machine key on p.178.
  • Configuration is inherited, <location> elements can be used to lock a setting which then cannot be overwritten (allowOverride=”false” location attribute)
  • 3.5 web apps have extra bits in the web.config (extension modules for ajax etc).
  • It’s possible to parse and even write config files programattically, for web apps use the WebConfigurationManager as the starting point.
  • WebSite Admin Tool (WAT) uses this approach.
  • Possible to extend configuration structure by adding to configSections and then define classes that inherit from ConfigurationSettings (e.g. WinWin)
  • Extend the HTTP Pipeline using HTTP handlers and modules – handlers were previously (ASP) done as ISAPI extentions, and Modules and ISAPI filters.
  • All ASP.NET requests are handled by httpHandlers which are defined in the root web.config.
  • httpModules are classes that can react to every request the web application gets. ASP.NET’s session state and authentication logic works through httpModules.
  • … 

 

 

 

Random Bits:

  • ASP.NET 3.5 is really just 2.0 with some bug fixes and a few bells and whistles.
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: