以下是我的代码,它试图从web.config获取自定义配置对象:
LdapConfiguration ldapConfig = (LdapConfiguration)ConfigurationManager.GetSection("ldapConfiguration");
当运行该行代码时,我得到this error page。
Here is screenshot表明我已经包含对包含配置对象的项目的引用:
在构建项目后,我确实在bin文件中看到了GTCCLdap.dll文件。
答案 0 :(得分:1)
您说该程序集名为GTCCLdap.dll
,但您的配置正在查找GTCC.Ldap.dll
。
除非您的问题出现问题,否则请将配置更改为:
<section name="ldapConfiguration" type="GTCC.Ldap.LdapConfiguration,GTCCLdap"/>