我正在尝试将 IIS Express 与 VS2010 一起使用来托管 silverlight 应用程序。我修改了 applicationhost.config 文件以允许修改正确的配置设置。我的 web.config 中有以下内容:
<location path="">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</location>
我未经过身份验证,并且我的域服务调用以用户身份返回空记录。在安装 VS2010 SP1 BETA 后我能够让它工作,但我试图让它仅与 IIS Express 一起工作。
如何启用 Windows 身份验证以与 IIS Express 配合使用。是否有我缺少的配置设置?
Visual Studio 2010 SP1 和 2012 添加了对 IIS Express 的支持,无需编辑尖括号。
我相信这个解决方案优于 vikomall 的选择。
上面基于 UI 的解决方案使用 IIS Express 的 applicationHost.config 中特定于站点的位置元素,使应用程序保持不变。
更多信息在这里: http://msdn.microsoft.com/en-us/magazine/hh288080.aspx
选项-1:
编辑
\My Documents\IISExpress\config\applicationhost.config
文件并启用 windowsAuthentication,即:
<system.webServer>
...
<security>
...
<authentication>
<windowsAuthentication enabled="true" />
</authentication>
...
</security>
...
</system.webServer>
选项-2:
解锁 \My Documents\IISExpres 中的 windowsAuthentication 部分