我正在尝试使密码的登录要求不那么严格。我在 web.config 文件中设置了所有属性,但由于某种原因,它不喜欢我的 Type 属性。我查看了 StackOverflow 以及其他网站上有关 web.config Membership 的所有其他帖子,它们似乎都与我为 Type 所做的完全一样。在我的搜索中,我似乎也找不到太多关于这个错误的信息。我只是不知道为什么会收到此错误:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Attribute not recognized 'writeExceptionsToEventLog'
Source Error:
Line 16: <clear />
Line 17: <add name="AspNetSqlMembershipProvider"
Line 18: type="System.Web.Security.SqlMembershipProvider"
Line 19: connectionStringName="CafeWorksConnectionString"
Line 20: requiresQuestionAndAnswer="false"
这是我的 web.config 文件(稍作修改以删除敏感信息)
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="validationSettings:UnobtrusiveValidationMode" value="None"/>
</appSettings>
<system.web>
<authentication mode="Forms" />
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="CafeWorksConnectionString"
requiresQuestionAndAnswer="false"
enablePasswordRetrieval="false" enablePasswordReset="true"
requiresUniqueEmail="false" passwordFormat="Hashed"
minRequiredNonalphanumericCharacters="0" writeExceptionsToEventLog="false"
minRequiredPasswordLength="4" passwordStrengthRegularExpression=""
passwordAttemptWindow="10" maxInvalidPasswordAttempts="8"/>
</providers>
</membership>
</system.web>
<system.net>
<mailSettings>
<smtp from="Name@EmailHost.com">
<network host="EmailHost" password="" userName="" />
</smtp>
</mailSettings>
</system.net>
<connectionStrings>
<add name="CafeWorksConnectionString" connectionString="Data Source=DB;Initial Catalog=DBCatalog;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
如果有人知道如何纠正此错误,我将不胜感激。我完全不知道“writeExceptionsToEventLog”发生在哪里以及它为什么会导致我的错误。
谢谢!