【发布时间】:2018-01-29 23:40:52
【问题描述】:
总结:如果代理设置为自动发现,我们的 .NET WPF 应用程序似乎不会检测到代理。这意味着我们的应用程序在尝试使用 Azure AD 进行身份验证以及我们尝试下载用于登录应用程序的令牌时失败。
但是,如果我们在 Internet 选项中手动定义代理设置,则应用程序可以正常加载。
即当下面设置为代理服务器IP。
另一个有趣的点是,当代理设置为自动检测我们是否通过 Internet Explorer 或 chrome 联系我们的服务时,我们可以看到 WSDL。
我们怀疑问题可能出在我们系统的 Microsoft azure 身份验证部分绕过代理。在这个特定的网络设置中,任何绕过代理的东西都无法通过火灾,因此,应用程序失败并出现错误“未知错误:未知错误”。
我们尝试过的主要内容包括: • 这在 app.config 的 system.net 部分中:
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy bypassonlocal="True" usesystemdefault="True" />
</defaultProxy>
</system.net>
• 这在 app.config 的绑定部分中(注意 bypassProxyOnLocal=”true”、useDefaultWebProxy=”true” 和 proxyCredentialType=”Windows”):
<wsHttpBinding>
<binding name="InternalWsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="true" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="Message">
<transport clientCredentialType="None" proxyCredentialType="Windows" realm="" />
</security>
</binding>
</wsHttpBinding>
【问题讨论】: