gpt4 book ai didi

asp.net-mvc - 在本地通过 IIS Express 使用 SSL 时如何配置 Web 代理?

转载 作者:太空宇宙 更新时间:2023-11-03 13:09:08 27 4
gpt4 key购买 nike

我最近关注了Scott Hansleman's instructions on setting up SSL locally将 IIS Express 用于我的 Azure Web 应用程序。这似乎工作正常(能够访问需要 SSL 的页面),直到我到达一个查询表存储的页面。它抛出了以下内容:

Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.

所以我将其添加到我的 web.config 中:

    <defaultProxy>
<proxy usesystemdefault="False"/>
</defaultProxy>

现在它在同一行抛出不同的错误:

The type initializer for 'System.Net.ServicePointManager' threw an exception.

深入研究它引用了我的 web.config 的第 29 行并说:

Required attribute 'type' not found.

然而,第29行对我来说似乎没有任何意义。这是相关部分:

25 <system.diagnostics>
26 <trace>
27 <listeners>
28 <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
29 <filter />
30 </add>
31 </listeners>
32 </trace>
33 </system.diagnostics>

我认为问题可能出在 IIS applicationhost.config 中,如果我在 VS 中打开它会给我一堆缺少元素的错误,但我认为它没有使用正确的架构,因为我找不到任何说明的文档这些元素(主要是 configSection 元素)甚至具有这些属性。

这有点超出我的能力范围,而且我的搜索运气不佳。

最佳答案

显然错误日志是正确的。即使它发出“不允许类型属性”的警告,将 type=""添加到过滤器节点上的 web.config 也可以解决问题。我什至可以删除我添加的 defaultProxy 节点。

这是网络配置的新相关部分:

    <system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>

关于asp.net-mvc - 在本地通过 IIS Express 使用 SSL 时如何配置 Web 代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9752768/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com