gpt4 book ai didi

asp.net - HTTP 错误 500.19 - 更改 web.config 时出现内部服务器错误

转载 作者:行者123 更新时间:2023-12-01 12:32:56 26 4
gpt4 key购买 nike

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

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid

详细信息:

 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>

可能是什么问题?

最佳答案

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

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

关于asp.net - HTTP 错误 500.19 - 更改 web.config 时出现内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31914580/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com