【问题标题】:Additional sections in ASP.NET web.config file errorASP.NET web.config 文件错误中的其他部分
【发布时间】:2012-03-25 03:02:12
【问题描述】:

我有旧版 ASP.NET 网站,从 ASP.NET 2.0 升级到 ASP.NET 4.0 目标框架。很遗憾,但是旧的 web.config 文件使用了太多的自定义部分,与 appSettings 处于同一级别。

网站编译时出现错误"Unrecognized configuration section MyCustomSection"。是否可以不重构所有代码并将自定义配置部分保留在 web.config 文件中?

【问题讨论】:

    标签: asp.net web-config custom-sections


    【解决方案1】:

    您是否已将 MyCustomSection 添加到配置部分?

    <configSections>
    <section name="MyCustomSection"... />
    </configSections>
    

    【讨论】:

    • 这对我不起作用,因为这个自定义部分没有任何类型。它们只是按用途分组的附加设置。
    • 我的错,这是正确的解决方案。我会缺少程序集引用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-09
    相关资源
    最近更新 更多