【问题标题】:HTTP Error 500.19 - Internal Server Error when i changed web.configHTTP 错误 500.19 - 我更改 web.config 时出现内部服务器错误
【发布时间】:2015-08-10 08:08:22
【问题描述】:

我想在我的网站上添加注册功能。当我在 Web.config 中添加配置时,运行项目时出现以下错误:

HTTP 错误 500.19 - 内部服务器错误 无法访问请求的页面 访问,因为该页面的相关配置数据是 无效

详情:

 Detailed Error Information:
    Module     IIS Web Core
    Notification       Unknown
    Handler    Not yet determined
    Error Code     0x80070032
    Config Error       The configuration section 'authentication' cannot be read because it is missing a section declaration

我的 web.config:

<connectionStrings>      
    <add name="Model12" connectionString="data source=.\SQLEXPRESS;initial catalog=test123;integrated security=True; />
  </connectionStrings>

  <authentication mode="Forms">
 <forms loginUrl="~/FirstPage.aspx" timeout="2880" />
</authentication>

 <membership defaultProvider="CustomMembershipProvider">
     <providers>
     <clear />
     <add name="CustomMembershipProvider"
          type="MyMembershipProvider"
          connectionStringName="Model12"
          enablePasswordReset="true"
          maxInvalidPasswordAttempts="5"
          minRequiredPasswordLength="6"
          minRequiredNonalphanumericCharacters="0"
          passwordAttemptWindow="10"
          applicationName="/" />
     </providers>
</membership>

可能是什么问题?

【问题讨论】:

  • 确保authentication & membership 标签在system.web 标签内。而connectionStrings 应该是configuration 的直接子代。
  • 请包含所有 web.config 以验证标签是否格式正确,似乎不是。

标签: asp.net


【解决方案1】:

您从 IIS 收到的消息告诉您,它无法识别您在“connectionStrings”元素下的“身份验证”元素。这是因为它应该像这样保存在“system.web”元素中:

<system.web>
    <!-- Other system.web sections here-->
    <authentication mode="Forms">
        <forms loginUrl="~/FirstPage.aspx" timeout="2880"/>
    </authentication>
</system.web>

【讨论】:

  • 绝对完美
猜你喜欢
  • 2021-12-25
  • 2012-06-15
  • 2012-06-03
  • 1970-01-01
  • 2015-11-12
  • 2015-09-05
  • 2015-09-20
  • 2021-05-09
相关资源
最近更新 更多