【发布时间】:2013-04-23 12:06:10
【问题描述】:
我有一个定义了自定义部分的 dot.NET 4.0 Web 应用程序:
<configuration>
<configSections>
<section name="registrations" type="System.Configuration.IgnoreSectionHandler, System.Configuration, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="true" restartOnExternalChanges="true" allowLocation="true"/>
....
在 web.config 文件的末尾我有相应的部分:
....
<registrations>
.....
</registrations>
</configuration>
每次我拨打System.Configuration.ConfigurationManager.GetSection("registrations"); 时都会收到以下异常:
为注册创建配置节处理程序时出错:给定的程序集名称或代码库无效。 (HRESULT 异常:0x80131047)(C:\...\web.config 第 13 行)
我也在使用 Unity,但不知道这是否与错误有关。
您以前遇到过这个错误吗?我该如何解决?我需要用其他东西替换IgnoreSectionHandler 吗?
【问题讨论】:
标签: c# asp.net c#-4.0 web-config unity-container