日期:2014-05-16  浏览次数:20340 次

求助,configSections配置节报错
报的错:



代码部分:


APPConfig文件


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="VideoSupport" type="Rename_Tool.Config.VideoSupport.VideoSupportCfgSectionHandler"/>
</configSections>

<!--支持提取的视频格式-->
<VideoSupport>
<VideoPatterns>
<!--IgnoreCase为1时不区分大小写,为0时区分大小写-->>
<VideoPattern VideoName="avi"  IgnoreCase ="1"/>
<VideoPattern VideoName="rmvb" IgnoreCase ="1"/>
<VideoPattern VideoName="mp4"  IgnoreCase ="1"/>
<VideoPattern VideoName="flv"  IgnoreCase ="1"/>
<VideoPattern VideoName="wma"  IgnoreCase ="1"/>
<VideoPattern VideoName="wmv"  IgnoreCase ="1"/>
<VideoPattern VideoName="rm"   IgnoreCase ="1"/>
<VideoPattern VideoName="3gp"  IgnoreCase ="1"/>
<VideoPattern VideoName="mkv"  IgnoreCase ="1"/>
</VideoPatterns>
</VideoSupport>

</configuration>


取配置段的方法

        private VideoSupportCfg()
        {
            _videoSupportSection = System.Configuration.ConfigurationManager.GetSection("VideoSupport") as VideoSupportCfgSectionHandler;
        }

VideoSupportCfgSectionHandler类的命名空间:
namespace Rename_Tool.Config.VideoSupport
------解决方案--------------------
http://bbs.csdn.net/topics/300249342 见此页