home *** CD-ROM | disk | FTP | other *** search
- <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
-
- <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
-
- <h4>Deploying ASP+ Applications</h4>
-
- <div class="indent" style="font-family:Verdana; font-size:8pt;">
- <b> <img align="middle" src="/quickstart/images/bullet.gif"> </b>
- <a class="toc2" target="content" href="#fslayout">File System Layout of ASP+ Applications</a><br>
- <b> <img align="middle" src="/quickstart/images/bullet.gif"> </b>
- <a class="toc2" target="content" href="#resolvingassemblies">Resolving Class References to Assemblies</a><br>
- <b> <img align="middle" src="/quickstart/images/bullet.gif"> </b>
- <a class="toc2" target="content" href="#startup">ASP+ Application Startup and Class Resolution</a><br>
- <b> <img align="middle" src="/quickstart/images/bullet.gif"> </b>
- <a class="toc2" target="content" href="#codereplacement">Code Replacement</a><br>
- </div>
-
-
- <p>
- <hr>
-
-
-
- <!--BEGIN SUB SECTION-->
- <a name="fslayout">
- <span class="subhead">File System Layout of ASP+ Applications</span>
- <p>
- ASP+ can be used to host multiple web applications - each identified using a unique
- URL prefix within a web site (where a "web site" is represented on a webserver as a
- unique HostName/Port combination). For example, a single Microsoft Internet Information
- Server (IIS) web server with two mapped IP addresses (one aliased to "www.msn.com" and
- the other to "intranet") and three logical sites (http://intranet, http://www.msn.com,
- http://ww.msn.com port 81) could expose the following six ASP+ Applications:
- <p>
- <div class="indent">
- <table class="table2" cellpadding="3" width="450">
- <tr> <th>Application URL</th>
- <th>Description</th></tr>
- <tr> <td>http://intranet</td>
- <td>"Root" application on intranet site</td></tr>
- <tr> <td>http://www.msn.com</td>
- <td>"Root" application on www.msn.com site</td></tr>
- <tr> <td>http://www.msn.com:81</td>
- <td>"Root" application on www.msn.com port 81 site</td></tr>
- <tr> <td>http://intranet/training</td>
- <td>"Training" application on intranet site</td></tr>
- <tr> <td>http://intranet/hr</td>
- <td>"HR" application on intranet site</td></tr>
- <tr> <td>http://intranet/hr/compensation/</td>
- <td>"Compensation" application on intranet site</td></tr>
- </table>
- </div>
- <p>
-
- <b>Note:</b> The URL for the "Compensation Application" above is rooted within the
- "HR Application" URL namespace. This URL hierarchy notation does not imply that the
- "Compensation App" is contained or nested within the "HR Application". Each application
- instead maintains an independent set of configuration and class-resolution properties
- - both are logical peer children of the "intranet" site.
-
- <p>
- Each ASP+ application exposed within a URL namespace is backed using a file system
- directory located on either a local or remote file share. There is no requirement
- for application directories to be centrally located within a contiguous part of the
- file system (they can be scattered throughout a disk). For example, the ASP+ Application
- listed above could be located in the following different directories:
- <p>
-
- <div class="indent">
- <table class="table2" cellpadding="3" width="450">
- <tr> <th>Application URL</th>
- <th>Physical Path</th></tr>
- <tr> <td>http://intranet</td>
- <td>c:\inetpub\wwwroot</td></tr>
- <tr> <td>http://www.msn.com</td>
- <td>c:\inetpub\msnroot</td></tr>
- <tr> <td>http://www.msn.com:81</td>
- <td>d:\msnroot81</td></tr>
- <tr> <td>http://intranet/training</td>
- <td>d:\serverapps\trainingapp</td></tr>
- <tr> <td>http://intranet/hr</td>
- <td>\\billg42\sillystuff\reviews</td></tr>
- <tr> <td>http://intranet/hr/compensation/</td>
- <td>c:\inetpub\wwwroot\compensation</td></tr>
- </table>
- </div>
-
-
-
- <!--BEGIN SUB SECTION-->
- <br>
- <a name="resolvingassemblies">
- <br>
- <span class="subhead">Resolving Class References to Assemblies</span>
- <p>
- Assemblies are the unit of class deployment in the NGWS runtime. Developers writing
- NGWS classes using Visual Studio 7.0 will produce a new assembly with each
- Visual Studio project they compile. Although it is possible to have an assembly
- span multiple Portable Executable (PE) files (ie: several module DLLs),
- Microsoft Visual Studio version 7.0 (VS7) will by default
- compile all assembly code into a single DLL (1 VS7 Project = 1 NGWS Assembly = 1 Physical DLL).
-
- <p>
- An assembly can be used on a computer by deploying it into an assembly cache.
- The assembly cache can either be global to a computer or local to a particular
- application. It is expected that only code intended to be shared across multiple
- applications will be placed in the global system assembly cache. Code specific
- to a particular application (for example: most web application logic) will most
- likely be deployed in the application's local assembly cache. One nice advantage
- of deploying an assembly within an application's local assembly cache is that only
- code within that application can access it (a nice feature for scenarios involving
- ISPs). It also facilitates side-by-side versioning of the same application (since
- classes are private to each application version instance).
- <p>
- An assembly can be deployed into an application's local assembly cache by simply copying,
- xcopying, or FTPing the the appropriate file(s) into a directory that has been marked as an
- "assembly cache location" for that particular application. No additional registration
- utility needs to be run once the appropriate files are copied and no reboot is necessary.
- This removes the headaches required today to deploy classic COM components within ASP applications
- (an administrator currently has to log onto the web server locally and run regsrv32).
- <p>
- By default, an ASP+ application is automatically configured to use the "bin" sub-directory
- located immediately under the application root as its local assembly cache. The bin directory
- is also configured to deny any browser access - so that a remote client cannot download
- and steal the code. For example, the following might be the directory layout for an ASP+ application,
- where the /bin directory is immediately under the application root:
-
- <div class="code"><xmp>
- C:\inetpub\wwwroot
- Web.cfg
- Default.aspx
-
- \bin <= Application Assembly Cache Directory
- MyPages.dll
- MyBizLogic.dll
-
- \order
- SubmitOrder.aspx
- OrderFailed.aspx
-
- \img
- HappyFace.gif
- </xmp></div>
-
-
- <!--BEGIN SUB SECTION-->
- <a name="startup">
- <span class="subhead">ASP+ Application Startup and Class Resolution</span>
- <p>
- ASP+ Applications are lazily constructed the first time a client requests a URL
- resource from them. Each ASP+ Application is launched within a unique Application
- Domain (AppDomain) - a new NGWS runtime construct that enables process hosts to provide extensive
- code/security/configuration isolation at runtime.
- <p>
- ASP+ is responsible for manually creating an application-domain when a new application
- is started. As part of this process, ASP+ provides configuration settings for the NGWS runtime
- to use. These include:
- <ul>
- <li>The directory paths that makeup the local assembly cache (Note: it is the NGWS
- Application-Domain isolation architecture that allows each application to maintain its
- own local assembly cache).
- <li>The security restrictions of the application (what can the application access on the system).
- </ul>
- <p>
-
- Because ASP+ does not have any compile-time knowledge of the applications developers will
- write on top of it, it cannot utilize static references to resolve and reference application code.
- Instead, ASP+ must utilize a dynamic class/assembly resolution approach to make the "initial hop"
- from the ASP+ Runtime into application code.
- <p>
- ASP+ configuration and page activation files will enable developers to dynamically reference
- a target compiled NGWS class to run by specifying an assembly and class name combination.
- The string format for this union follows the pattern:
- <p>
- <div class="code">assemblyname#classname</div>
- <p>
- The NGWS runtime can then use this simple string reference to resolve and load the appropriate class.
-
-
-
- <!--BEGIN SUB SECTION-->
- <br>
- <a name="codereplacement">
- <br>
- <span class="subhead">Code Replacement</span>
- <p>
- NGWS Assemblies are typically compiled and deployed into a Windows DLL-based
- PE format. When the NGWS runtime's loader resolves a class implemented within this type
- of assembly, it calls the Windows LoadLibrary routine on the file (which locks
- its access on disk), and then maps the appropriate code data into memory for
- runtime execution. Once loaded, the DLL file will remain locked on disk until
- the Application-Domain referencing it is either torn-down or manually recycled.
-
- <p>
- Although ASP+ cannot prevent the NGWS runtime from locking a loaded assembly DLL on disk,
- it can support developers by ensuring that the physical DLLs
- they place into an web application's private assembly cache are never actually
- loaded by the runtime. Instead, shadow copies of the assembly DLLs are made immediately
- prior to their use. These shadow assemblies - and not the original files - are then
- locked and loaded by the runtime.
-
- <p>
- Because the original assembly files always remain unlocked, developers and
- administrators are free to delete/replace/rename them without cycling the web server
- or having to use a special tool. FTP and similar methods work just fine. ASP+ maintains an
- active list of all assemblies loaded within a particular application's application domain
- and uses file-change monitoring code to watch for any updates to the original files.
-
-
-
- <h4>Section Summary</h4>
- <ol>
- <li>ASP+ applications are identified by a unique URL and live in the file system of
- the web server.
- <li>ASP+ can use shared assemblies, which reside in the global cache, and
- application-specific assemblies, which reside in the "bin" directory of the application's
- virtual root.
- <li>ASP+ applications run in the context of AppDomains, which provide isolation and
- enforcement of security restrictions.
- <li>Classes can be dynamically referenced via "assemblyname#classname".
- <li>ASP+ uses shadow-copies of assembly files to avoid locking and monitors the files,
- so that changes are picked up immediately.
- </ol>
- <p>
-
-
- <!-- #include virtual="/quickstart/include/footer.inc" -->
-
-
- <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->