如何在machine.config设置asp.net的缓存
在C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG目录下,打开machine.config文件,如何进行缓存设置? 
 微软的帮助里这样描述: 
 (http://www.microsoft.com/china/MSDN/library/WebServices/ASP.NET/ASP.NETCaching-TechniquesandBestPractiCEs.mspx?mfr=true)   
 配置 
 CacheConfig   从   web.config   文件读取其所有配置设置。指定的节和该节内的每个键值都使用缺省值定义为静态字符串,如代码示例   1   所示。   
 代码示例   1.   配置节和键名   
 protected   static   string   cacheSettingsConfigName   =    "CacheSettings ";    
 protected   static   string   EnableCachingKey   =    "EnableCaching ";    
 protected   static   string   RequireKeyDefinitionInConfigKey   =       
        "RequireKeyDefinitionInConfig ";    
 protected   static   string   DefaultCacheDurationUnitsKey   =       
        "DefaultCacheDurationUnits ";    
 protected   static   string   DefaultCacheDurationValueKey   =       
        "DefaultCacheDurationValue ";      
 默认情况下,所有   CacheConfig   配置设置都存储在名为    "CacheSettings "   的自定义配置节中。该节被定义为简单的   NameValueCollection,就像内置的   AppSettings   配置节一样。必须把该新配置节定义在   web.config   中,如代码示例   2   所示。   
 代码示例   2.   在   web.config   中定义   CacheSettings   配置节   
  <configSections>     
  <section   name= "CacheSettings "       
       type= "System.Configuration.NameValueFileSectionHandler,   System,       
       Version=1.0.3300.0,   Culture=neutral,   PublicKeyToken=b77a5c561934e089 "       
       />     
  </configSections>       
  <configSections>    元素必须是   web.config   配置元素中的第一个元素。   
 一旦该节在   web.config   中定义并添加适当的键,它将在应用程序中管理   CacheConfig   类的行为。代码示例   3   显示了示例   CacheSettings   节。   
 代码示例   3.   CacheSettings   键和值   
  <CacheSettings>     
  <!--   true/false   -->     
  <add   key= "EnableCaching "   value= "true "   />     
  <!--   true/false   -->     
  <add   key= "RequireKeyDefinitionInConfig "   value= "true "   />     
  <!--   seconds,   minutes,   or   hours   -->     
  <add   key= "DefaultCacheDurationUnits "   value= "seconds "   />     
  <!--   integer   -->     
  <add   key= "DefaultCacheDurationValue "   value= "30 "   />     
  <!--   Cache   Keys   and   Durations   -       
 use    "default "   for   value   to   use   default   otherwise   integer.   -->     
  <add   key= "AuthorsDataTable "   value= "default "   />     
  <add   key= "AuthorsDataTableByState "   value= "10 "   />     
  </CacheSettings>       
 前四个键对   CacheConfig   的行为影响最大。最后几个键定义了所有对象的缓存键名和缓存持续时间,这些对象存储在使用   CacheConfig   的缓存中。表   1   描述了前几个配置值的效果。   
 但按照上面加上代码,会提示错误如下:   
 配置错误    
 说明:   在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。      
 分析器错误信息:   无法识别的配置节“CacheSettings”   
 源错误:        
 行   46:    
 行   47: