使用Windows身份验证的新MVC5应用程序安装到IIS7

时间:2015-09-23 19:09:40

标签: c# asp.net-mvc iis-7

我已经通过启用了Windows身份验证的Visual Studio 2013创建了一个全新的Web应用程序项目。除了创建和调试它之外,该网站没有做任何事情。调试站点工作正常(使用右上角显示的正确的机器/用户自动登录),但是,一旦我将站点部署到本地计算机,我会收到用户名和密码的提示。

如果我在被要求提供信用时点击取消,我会收到以下错误: HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers.

我采取的步骤:

  1. 在IIS中创建网站
  2. 指定应用程序池使用.NET 4.0
  3. 从身份验证选项中启用Windows Auth并关闭匿名身份验证
  4. 使用我的IP
  5. 将网站添加到我的主机文件中
  6. 使用VS
  7. 中的网络发布选项部署网站

    我的webconfig具有以下system.web:

    <system.web>
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
        <authentication mode="Windows" />
        <authorization>
          <deny users="?" />
        </authorization>
      </system.web>
    

    一点额外: 当我编辑绑定并删除主机名并将端口设置为82时,我可以通过localhost:82

    导航到它

    这次基本部署我缺少什么?我已经搜索了关于将一个带有Windows身份验证的通用站点部署到IIS7但尚未提出任何内容的简单文章。

0 个答案:

没有答案