Introduction to ASP.NET Applications


Sams Teach Yourself ASP.NET in 21 Days, Second Edition
By Chris Payne
Table of Contents
Day 18.  Configuring and Deploying ASP.NET Applications

So far, you've explored most of the concepts in ASP.NET, from the basics of Web forms to building complex business objects. Using these components, you can build very powerful pages to perform just about any task. The next step is bringing everything together to form a single application, and configuring and deploying that application.

You can simply group a bunch of ASP.NET pages together and call it an application, but the formal definition extends a bit further. An ASP.NET application is defined as follows: the sum of all files, pages, event handlers, modules, and executable code that is invoked or run within the scope of a given virtual directory (and its subdirectories) on a Web application server. That's quite a mouthful.

Recall from Day 1, "Getting Started with ASP.NET," that a virtual directory is any directory that is not contained in your home directory, but that appears to Web clients as though it were. For example, if you have the default setup for IIS, c:\inetpub\wwwroot is one virtual directory (your home directory), and it is viewable from a Web client on your machine as http://localhost. Another virtual directory could be at c:\myweb\mysite, but still might be viewable as http://localhost/mysite. The second directory is not in your home directory, but Web clients wouldn't know the difference. You can create a virtual directory through the Internet Service Manager easily (see Day 1 for a refresher).

Subfolders within these virtual directory folders are not necessarily virtual directories, but can be if you set them up as such. Figure 18.1 shows a typical list of virtual directories on a Windows 2000 machine.

Figure 18.1. A typical virtual directory listing in IIS 5.0 on Windows 2000, shown through the Internet Services Manager.


ASP.NET applications are completely separate entities. Each ASP.NET application is handled in its own .NET runtime Application Domain (refer to the "Processing" section of Day 2, "Building ASP.NET Pages"), which means that each application can maintain its own set of configuration values and properties. So, given two virtual directories http://localhost/MyASP and http://localhost/MyASP/App2 the latter virtual directory is a completely separate application, and is not contained or embedded within the first.

An ASP.NET application is created the first time a user makes a request from the server (more on this later). After this happens, you are able to use various application events to control execution of your program via the global.asax file, which I'll cover in depth later today.

The /bin Directory


ASP.NET introduces a new special directory for its applications: the /bin directory, also known as the assembly cache. As you learned from your lessons in business objects, this directory holds compiled binary files used by your applications (for example, DLLs). Each application has its own assembly cache, but can inherit one from its parent.

This directory is very important for ASP.NET applications. It provides an easily accessible store for objects used by your application. Assemblies placed here are automatically available to your .aspx files, so you don't have to worry about complex creation or registration procedures. For more information on using this directory, see Day 15, "Using Business Objects."


    Sams Teach Yourself ASP. NET in 21 Days
    Sams Teach Yourself ASP.NET in 21 Days (2nd Edition)
    ISBN: 0672324458
    EAN: 2147483647
    Year: 2003
    Pages: 307
    Authors: Chris Payne

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: