开发者

Impersonate tag in Web.Config

I'm using impersonate tag in my web.config in Asp.net 4.0 website.

Below is my Web.Config code:

<system.web>
    <authentication mode="Windows">
        <identity impersonate="true"                 
            userName="Administrator" 
            password="LALLA$26526"/>
     </authentication>
</system.web>

When I run app in Visual Studio I get this error:

Parser Error Message: Unrecognized element 'identity'.

Source Error:

Line 50:    <system.web>
Line 51:        <authentication mode="Windows">
Line 52:            <identity impersonate="true"             
Line 53:     开发者_Python百科            userName="Administrator"
Line 54:                 password="LALLA$26526"/>

Where am i going wrong?


The identity section goes under the system.web section, not under authentication:

<system.web>
  <authentication mode="Windows"/>
  <identity impersonate="true" userName="foo" password="bar"/>
</system.web>


Put the identity element before the authentication element


You had the identity node as a child of authentication node. That was the issue. As in the example above, authentication and identity nodes must be children of the system.web node

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜