home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / aspplus / doc / configformat.aspx < prev    next >
Encoding:
Text File  |  2000-06-13  |  8.3 KB  |  130 lines

  1.     
  2. <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
  3.  
  4. <h4>Configuration File Format</h4>
  5.  
  6. ASP+ configuration files are XML-based text files û each named config.web û that can appear in any directory on an ASP+ Web 
  7. Application Server.
  8.  
  9. Each config.web file applies configuration settings to the directory it is located within and all virtual child directories beneath it.   Settings in 
  10. child directories can optionally override or modify settings specified in parent directories.  A root configuration file û 
  11. WinNT\ComPlus\<version>\config.web û provides default configuration settings for the entire machine.  
  12. ASP+ configures IIS to prevent direct browser access to config.web files (ensuring that their values canÆt become public) û 
  13. returning 404: Forbidden errors when attempts are made to do so).
  14. <p>
  15. At runtime ASP+ uses these config.web configuration files to hierarchically compute a unique collection of settings for each incoming 
  16. URL target request (note: these settings are only calculated once and then cached across subsequent requests û ASP+ automatically 
  17. watches for file changes and will invalidate the cache if any of the configuration files change).
  18. <p>
  19. For example, the configuration settings for the URL: <u>http://myserver/myapplication/mydir/page.aspx</u> would be computed by applying 
  20. config.web file settings in the following order:
  21. <p>
  22. <div class="code"><pre>
  23. C:\WinNT\ComPlus\1710\config.web             <= Base Configuration Settings for Machine
  24. D:\MyApplication\config.web                      <= Overriden by Application Configuration Settings
  25. D:\MyApplication\MyDir\config.web             <= Overriden by Sub-Directory Config Settings
  26. </pre></div>
  27.  
  28. If a config.web file is present at the root directory for a site, for example "Inetpub\wwwroot", those configuration settings will apply to every application in that site.  Note that the presence of a config.web file within a given directory or application root is completely optional.  If a config.web file is not present, then all configuration settings for the directory are automatically inherited from the parent directory.
  29.  
  30. <h5>Configuration Section Handlers and Sections</h5>
  31.  
  32. A config.web configuration file is an XML-based text file that can contain standard XML document elements û 
  33. including well-formed tags, comments, text, cdata, etc.  The file may ANSI, UTF-8, or Unicode -- the system will automatically detect the encoding.
  34.  
  35. The root element of a config.web file is always a <configuration> tag.  ASP+ and end-user settings are then encapsulated within this 
  36. tag:
  37.  
  38. <div class="code"><pre>
  39. <configuration>
  40.     <!ù Configuration Settings Would Go Hereà -->
  41. </configuration>
  42. </pre></div>
  43.  
  44. The <configuration> tag typically contains two different types of elements: 1) configuration section handler declarations, and 
  45. 2) configuration section settings.
  46. <p>
  47.  
  48. <ul>
  49.  
  50. <li><b>Configuration Section Handlers</b>  - The ASP+ configuration infrastructure makes no assumptions regarding the file-format or supported settings within a config.web file.  
  51. Instead, it delegates the processing of config.web data to "configuration section handlers" û NGWS runtime classes that implement the 
  52. IConfigurationSectionHandler interface.  An individual IConfigurationSectionHandler declaration only needs to appear once, typically at the 
  53. machineÆs root config.web file. The config.web files in child directories automatically inherit this declaration.
  54. Configuration section handlers are declared within a config.web file using "add" tag directives nested within a containing 
  55. <configsections> tag.  Each ôaddö tag identifies a tag name denoting a specific section of configuration data, and an 
  56. associated IConfigurationSectionHandler class that processes it.  
  57. <p>
  58.  
  59. <li><b>Configuration Sections</b> - ASP+ configuration settings are represented within "configuration tag sections", also nested within a <configuration> tag.  For each
  60. configuration section, an appropriate section handler must be defined in the config hierarchy.  For example, in the sample below the 
  61. tag <httpmodules> is the configuration section that defines the "httphandlers" configuration data.  It is the 
  62. System.Web.Configuration.HttpModulesConfigurationHandler class that is responsible for interpreting the content contained 
  63. within the <httpmodules> tag at runtime.  
  64.  
  65. </ul>
  66.  
  67. <p>
  68. <div class="code"><pre>
  69. <configuration>
  70.  
  71.     <configsections>
  72.         <add name="httpmodules" type="System.Web.Configuration.HttpModulesConfigurationHandler" />
  73.     </configsections>
  74.  
  75.     <httpmodules>
  76.         <add type="System.Web.SessionState.CookielessSessionModule" />
  77.         <add type="System.Web.Caching.OutputCacheModule" />
  78.         <add type="System.Web.SessionState.SessionStateModule" />
  79.         <add type="System.Web.Security.WindowsAuthenticationModule" />
  80.         <add type="System.Web.Security.CookieAuthenticationModule" />
  81.         <add type="System.Web.Security.PassportAuthenticationModule" />
  82.         <add type="System.Web.Security.CustomAuthenticationModule" />
  83.         <add type="System.Web.Security.UrlAuthorizationModule" />
  84.         <add type="System.Web.Security.FileAuthorizationModule" />
  85.     </httpmodules>
  86.  
  87. </configuration>
  88. </pre></div>
  89.  
  90. <h5>Standard ASP+ Configuration Section Handlers</h5>
  91.  
  92. ASP+ ships with a number of standard configuration section handlers that are used to process configuration settings within 
  93. config.web files.  Each section is briefly described below, along with a pointer to where more information can be found.
  94. <p>
  95.  
  96. <table class="table2" width="90%" cellpadding=3>
  97. <tr>
  98. <th>Section Name</th><th width="100%">Description</th>
  99. </tr>
  100. <tr>
  101. <td><b><httpmodules></b></td><td>Responsible for configuring Http Modules within an application. Http Modules pariticipate in the processing of every request into an application, and common uses include security and logging.</td>
  102. </tr>
  103. <tr>
  104. <td><b><httphandlers></b></td><td>Responsible for mapping incoming URLs to IHttpHandler classes. Sub-directories do not inherit these settings.
  105. Also responsible for mapping incoming URLs to IHttpHandlerFactory classes.  Data represented in <httphandlerfactories> sections are hierarchically inherited by sub-directories.  For more information about this configuration section, refer to the <a href="httphandlers.aspx">Http Handlers and Factories</a> section of this tutorial.</td>
  106. </tr>
  107. <tr>
  108. <td><b><sessionstate></b></td><td>Responsible for configuring the session state HttpModule.  For more information about this configuration section, refer to the <a href="stateoverview.aspx">Managing Application State</a> section of this tutorial.</td>
  109. </tr>
  110. <tr>
  111. <td><b><globalization></b></td><td>Responsible for configuring the globalization settings of an application.  For more information about this configuration section, refer to the <a href="internationalization.aspx">Localization</a> section of this tutorial.</td>
  112. </tr>
  113. <tr>
  114. <td><b><compilation></b></td><td>Responsible for all compilation settings used by ASP+.  For more information about this configuration section, refer to the <a href="businessobjs.aspx">Business Objects</a> and <a href="debugcomsdk.aspx">Debugging</a> sections of this tutorial.</td>
  115. </tr>
  116. <tr>
  117. <td><b><trace></b></td><td>Responsible for configuring the ASP+ trace service. For more information about this configuration section, refer to the <a href="tracingoverview.aspx">Tracing</a> section of this tutorial.</td>
  118. </tr>
  119. <tr>
  120. <td><b><security></b></td><td>Responsible for all security settings used by the ASP+ security HttpModule.  For more information about this configuration section, refer to the <a href="securityoverview.aspx">Security</a> section of this tutorial.</td>
  121. </tr>
  122. <tr>
  123. <td><b><iisprocessmodel></b></td><td>Responsible for configuring the ASP+ process model settings on IIS Web Server Systems.  </td>
  124. </tr>
  125. <tr>
  126. <td><b><browsercaps></b></td><td>Responsible for controlling the settings of the browser capabilities component.  For more information about this configuration section, refer to the <a href="configretrieve.aspx">Retrieving Configuration</a> section of this tutorial.</td>
  127. </tr>
  128. </table>
  129.  
  130.     <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->