【问题标题】:asp.net Problem with assembly referenceasp.net 程序集参考问题
【发布时间】:2010-11-30 19:28:48
【问题描述】:

这是我尝试从 web.config 获取自定义配置对象的代码:

LdapConfiguration ldapConfig = (LdapConfiguration)ConfigurationManager.GetSection("ldapConfiguration");

当那行代码运行时,我得到this error page

Here is screenshot 表明我已包含对包含配置对象的项目的引用:

在我构建项目后,我确实在我的 bin 文件中看到了 GTCCLdap.dll 文件。

【问题讨论】:

    标签: .net asp.net configuration reference web-config


    【解决方案1】:

    您说该程序集称为GTCCLdap.dll,但您的配置正在寻找GTCC.Ldap.dll

    除非这是您的问题中的拼写错误,否则将您的配置更改为:

    <section name="ldapConfiguration" type="GTCC.Ldap.LdapConfiguration,GTCCLdap"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-13
      相关资源
      最近更新 更多