【问题标题】:Server Error - Access denied服务器错误 - 访问被拒绝
【发布时间】:2015-10-09 00:45:36
【问题描述】:

当我在 Visual Studio 2012 中运行我的网络应用程序时出现此错误。这发生在我将网络配置更改为 Windows 身份验证模式之后。

这些是我从原始网络配置更改的代码行。

     <httpRuntime targetFramework="4.5" />
        <authentication mode="Windows" />
        <identity impersonate="true" />
        <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">
            <providers>
                <clear />
                <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
            </providers>
        </roleManager>
        <authorization>
            <deny users="?" />
        </authorization>

实际上,当我将这个项目部署到 Web 服务器时,它工作得非常好。现在,我的问题是我无法使用 Visual Studio 2012 调试这个项目,因为我有这个错误。我试过打开其他项目,它使用视觉工作室工作,我的不是,但这两个有相同的设置。

【问题讨论】:

  • 在您的%WINDIR%\System32\inetsrv\config\applicationHost.config 中查找&lt;applicationPoolDefaults&gt;。在&lt;processModel&gt; 下,确保您没有setProfileEnvironment="false"。如果这样做,请将其设置为 true。
  • 已经设置为真了。
  • 当我访问这个网址时网站正在运行 [http:\\phpet-web05:8008]
  • 我的问题是当我使用 Visual Studio 调试我的代码时,当我尝试它时显​​示错误。
  • 没关系!!检查此设置1. Open iis and select the website that is causing the Issue 2. Open the “Authentication” property under the “IIS” header 3. Click the “Windows Authentication” item and click “Providers” 4. Move NTLM at top

标签: c# asp.net-mvc-4 iis visual-studio-2012


【解决方案1】:

请尝试以下操作:

  1. 转到 IIS 服务器,单击您创建的网站并查找 Windows 身份验证,不应该被禁用
  2. 检查文件夹是否保存了代码并尝试提供完整的 当前 AD 用户的权限。
  3. 或者,您可以尝试直接在您的主页中创建 .html 页面并尝试 浏览页面。

【讨论】:

    【解决方案2】:

    在 Visual Studio 中,您可以在项目属性中选择所需的服务器类型。您必须选择“IIS 服务器”和“创建虚拟目录”才能与部署服务器具有相同的配置,并且能够设置所有需要的参数。 您当然需要手动打开 IIS(在 VS 之外)以在您的开发网站上配置安全设置。

    【讨论】:

      猜你喜欢
      • 2015-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-19
      • 2021-03-22
      • 2018-05-01
      • 2021-02-01
      • 1970-01-01
      相关资源
      最近更新 更多