【发布时间】: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