c# - 无法停止 IIS Express 要求在我的本地 Silverlight 应用程序上对我进行身份验证
问题描述
编辑: 我不需要任何关于 Silverlight 几乎过时的傲慢回复。我当然知道这一点。当您为一家公司从事软件支持工作时(a)您无法使用时间机器来更改多年前做出的选择,并且(b)您通常必须支持不是最新的系统,因为“只需更换它”不一定是可能的。是的,这个系统正在被淘汰。如果纯粹是 Silverlight 对从 WebDev 到 IIS Express 的更改做出反应,那么请引用对该效果的引用。
我的笔记本电脑似乎有一个同事没有遇到的非常具体的问题。当我在本地运行最新版本的 Silverlight UI 解决方案时,我总是被要求登录。但是,我的用户凭据(与我用来登录笔记本电脑的凭据相同)总是被拒绝。
不同之处在于,在最新的解决方案中,我们现在调用的是 IIS Express。
以前的解决方案是这样运行的(通过启动批处理文件 - 我不清楚解决方案中发生了什么变化),如果我返回使用此表单,我可以避免身份验证
start webdev.webserver40.exe /port:{port number} /path:"%CD%\{application folder}"
而对于 IIS Express,我们使用的是:
start iisexpress.exe /config:"%CD%\{solution folder}\.vs\config\applicationhost.config" /site:{site name as shown in applicationhost.config}
我查看了 applicationhost.config 文件:
我最后改变了这个
<location path="{site path}">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" />
<windowsAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</location>
安全块看起来不错:
<access sslFlags="None" />
<applicationDependencies>
<application name="Active Server Pages" groupId="ASP" />
</applicationDependencies>
<authentication>
<anonymousAuthentication enabled="true" userName="" />
<basicAuthentication enabled="false" />
<clientCertificateMappingAuthentication enabled="false" />
<digestAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="false">
</iisClientCertificateMappingAuthentication>
<windowsAuthentication enabled="false">
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
</authentication>
<authorization>
<add accessType="Allow" users="*" />
</authorization>
<ipSecurity allowUnlisted="true" />
对我未经训练的眼睛。
最后我什至更新了 csproj.user 文件
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
<IISExpressUseClassicPipelineMode>false</IISExpressUseClassicPipelineMode>
</PropertyGroup>
使用 IIS Express 是错误的,并且启用了 Windows 并禁用了匿名。
但这些设置在旧代码中也是如此。
我真的很困惑可以在我的机器上设置什么。
注意:Windows 10、VS 2015。
解决方案
推荐阅读
- kotlin - 尽管如此,没有在所有路径上返回的自定义 getter 仍然可以编译
- docker - 如何重新访问 Docker 中的 bash 控制台?
- node.js - node-postgres:连接太多时 ECONNREFUSED
- android - 为部分添加空间项装饰
- python - 打印 1-100 的数字,跳过可被 3 和 5 整除的数字
- python - 自定义用户不是来自 django 的超级用户
- sql - 如何在给定的一周内获得每天数据的最大值
- sql - MS Access SQL - 如何从第一个月的第一天提取过去 13 个月的数据?
- wordpress - Ansible 取消归档文件到目标不可读
- ios - idevice中的GMT时间是否可能会失真?