在Web.Config中模拟标签 [英] Impersonate tag in Web.Config

查看:80
本文介绍了在Web.Config中模拟标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Asp.net 4.0网站的web.config中使用impersonate标记.

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

以下是我的Web.Config代码:

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

当我在Visual Studio中运行应用程序时,出现此错误:

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

Parser Error Message: Unrecognized element 'identity'.

源错误:

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

我要去哪里错了?

推荐答案

identity部分位于system.web部分下,而不位于authentication下:

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>

这篇关于在Web.Config中模拟标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆