我一直在我的webconfig dunno中收到此错误的原因。 我试图在我的asp.net c#网站上使用AD身份验证
<authentication mode="Forms">
<forms name=".ADAuthCookie" timeout="10"
loginUrl="Login.aspx" defaultUrl="Default.aspx">
</forms>
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<membership defaultProvider="DomainLoginMembershipProvider">
<providers>
<add name="DomainLoginMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionUsername="username" connectionPassword="password"/>
</providers>
</membership>
</configuration>
答案 0 :(得分:1)
您的错误消息是不言自明的。我可以从屏幕截图中清楚地看到,您已将authentication
部分直接包含在configuration
节点内,但它应该存在于system.web
节点内。所以你的Web.Config应该是这样的: -
<configuration>
<system.web>
<authentication mode="Forms">
<forms name=".ADAuthCookie" timeout="10"
loginUrl="Login.aspx" defaultUrl="Default.aspx">
</forms>
</authentication>
...Others
</system.web>
<connectionStrings>
<add name="ConnectionString" .....Others
</configuration>