WebConfig 自定义节点configSections配置信息

示例:
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <section name="RedisConfig" type=" WebApplication11Redis2.Controllers.RedisConfigInfo, WebApplication11--Redis2"/>
  </configSections>
  <RedisConfig WriteServerList="127.0.0.1:6379" ReadServerList="127.0.0.1:6379" MaxWritePoolSize="60" MaxReadPoolSize="60" AutoStart="true" LocalCacheTime="180" RecordeLog="false"/> 

坑:
section 节点下 的type格式: Fully qualified class name , assembly file name , version , culture , public key token
                                                完全合格的类名称、          程序集文件名、          版本、   文化、    公共密钥
Fully qualified class  name:命名空间+类名
程序集文件名:DLL名字
注意:程序集如果有横杠,代码中被转换成下杠,但是DLL依旧是中杠


来自为知笔记(Wiz)


posted on 2016-04-29 15:57  RushPasser  阅读(182)  评论(0编辑  收藏  举报