【发布时间】: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中查找<applicationPoolDefaults>。在<processModel>下,确保您没有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