当我从Visual Studio中运行项目中的Windows身份验证不工作

编程入门 行业动态 更新时间:2024-10-26 12:31:44
本文介绍了当我从Visual Studio中运行项目中的Windows身份验证不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Windows身份验证工作的很好,当我主持我在IIS上的ASP.NET MVC项目。但是,如果我运行这个从Visual Studio - 事实并非如此。

下面是我的web.config:

<身份验证模式=窗口/> <授权>   <拒绝用户=? /> < /授权>

我缺少的东西?

解决方案

如果你在IIS托管防爆preSS(你可能应该),请确保您已启用Windows身份验证的Web应用程序的性能。

通过,如果你在Visual Studio中的一个新的ASP.NET MVC应用程序4使用你会与下面的自述文件在屏幕上迎来了内联网应用模板的方式。因此,继续前进,尝试它,阅读它,并按照什么写有:

  

要使用这个模板与Windows Azure的身份验证,请参阅   go.microsoft/fwlink/?LinkID=267940.

     

否则,使用该模板Windows身份验证,请参阅   下面的说明:

     

托管在IIS防爆preSS:

        
  • 单击在解决方案资源管理器中的项目,选择项目。
  •   
  • 如果属性面板没有打开,打开它(F4)。
  •   
  • 在属性面板中为您的项目:   a)设置匿名身份验证改为已禁用。   b)将Windows身份验证,以   已启用。
  •         

    托管在IIS 7或更高版本:

            
  • 打开IIS管理器,然后导航至您的网站。
  •   
  • 在功能视图中,双击身份验证。
  •   
  • 在验证页面,选择Windows身份验证。如果Windows身份验证是不是一种选择,你需要确保   Windows身份验证是安装在服务器上。
  •         

    要在Windows上启用Windows身份验证:

         

    a)在控制面板中打开程序和功能。   b)选择Windows功能打开或关闭。   C)浏览到Internet Information Services>万维网服务>安全,并确保Windows身份验证节点已选中。

         

    要在Windows Server上启用Windows身份验证:

         

    a)在服务器管理器,选择Web服务器(IIS),然后单击添加角色服务。   B)导航到Web服务器>安全,并确保Windows身份验证节点已选中。

            
  • 在操作窗格中,单击启用使用Windows身份验证。
  •   
  • 在验证页面,选择匿名身​​份验证。
  •   
  • 在操作窗格中,单击禁用禁用匿名身份验证。
  •   

    Windows authentication works good when I host my ASP.NET MVC project on IIS. But if I run this from Visual Studio - it doesn't.

    Here is my Web.config:

    <authentication mode="Windows" /> <authorization> <deny users="?" /> </authorization>

    Am I missing something?

    解决方案

    If you are hosting in IIS Express (which you probably should), make sure you have enabled Windows Authentication in the properties of your Web Application.

    By the way if you create a new ASP.NET MVC 4 application in Visual Studio using the Intranet Application template you will be greeted with the following Readme on the screen. So go ahead, try it, read it and follow what's written there:

    To use this template with Windows Azure authentication, refer to go.microsoft/fwlink/?LinkID=267940.

    Otherwise, to use this template with Windows authentication, refer to the instructions below:

    Hosting on IIS Express:

  • Click on your project in the Solution Explorer to select the project.
  • If the Properties pane is not open, open it (F4).
  • In the Properties pane for your project: a) Set "Anonymous Authentication" to "Disabled". b) Set "Windows Authentication" to "Enabled".
  • Hosting on IIS 7 or later:

  • Open IIS Manager and navigate to your website.
  • In Features View, double-click Authentication.
  • On the Authentication page, select Windows authentication. If Windows authentication is not an option, you'll need to make sure Windows authentication is installed on the server.
  • To enable Windows authentication on Windows:

    a) In Control Panel open "Programs and Features". b) Select "Turn Windows features on or off". c) Navigate to Internet Information Services > World Wide Web Services > Security and make sure the Windows authentication node is checked.

    To enable Windows authentication on Windows Server:

    a) In Server Manager, select Web Server (IIS) and click Add Role Services. b) Navigate to Web Server > Security and make sure the Windows authentication node is checked.

  • In the Actions pane, click Enable to use Windows authentication.
  • On the Authentication page, select Anonymous authentication.
  • In the Actions pane, click Disable to disable anonymous authentication.
  • 更多推荐

    当我从Visual Studio中运行项目中的Windows身份验证不工作

    本文发布于:2023-11-05 04:42:03,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1559932.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:当我   身份验证   项目   工作   Visual

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!