.NET应用程序未检测到代理 - 当代理设置为自动发现时。 [英] .NET application not detecting proxy - when proxy is set to auto discover.

查看:110
本文介绍了.NET应用程序未检测到代理 - 当代理设置为自动发现时。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Summary: 我们的.NET WPF应用程序似乎没有检测到代理
if代理设置为自动发现。这意味着我们的应用程序在尝试使用Azure AD进行身份验证之后以及当我们尝试下载用于登录应用程序的令牌时失败。



但是,如果我们手动定义代理商
设置在互联网选项中的应用程序,则应用程序加载正常。



即当以下设置为代理服务器IP时。





另一个有趣的一点是,当代理设置为自动检测我们是否通过Internet Explorer或chrome联系我们的服务时,我们可以看到WSDL。


< p style ="padding-right:0px;字体大小:15像素;垂直对齐:基线;列表样式类型:无;行高:继承; font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;明确:两者;颜色:#242729">
我们怀疑 问题可能是我们系统绕过代理的Microsoft
身份验证部分。在这个特定的网络设置中绕过代理的任何东西都不能去因此,应用程序失败并显示错误"未知错误:未知错误"。



我们尝试过的关键事项



*这是app.config的system.net部分:

    < system.net>   
< defaultProxy useDefaultCredentials = " true" >
< proxy bypassonlocal = " True" usesystemdefault = " True" />
< / defaultProxy>
< /system.net>



•此< g class =" gr_ gr_32 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id =" 32" id =" 32">在< / g> app.config的bindings部分(注意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>




业务分析师/程序员Dalibor Saula

解决方案


摘要: 如果代理设置为自动发现,我们的.NET WPF应用程序似乎似乎没有检测到代理
。这意味着我们的应用程序在它之后就失败了尝试使用Azure AD进行身份验证,当我们尝试下载用于登录应用程序的令牌时。



然而,如果我们手动定义代理商
设置在互联网选项中的内容,则应用程序会正常加载。



,即当以下设置为代理服务器IP时。





另一个有趣的一点是,当代理设置为自动检测我们是否通过Internet Explorer或chrome联系我们的服务时,我们可以看到WSDL。


< p style ="padding-right:0px;字体大小:15像素;行高:继承; font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;垂直对齐:基线;明确:两者;颜色:#242729">
我们怀疑 问题可能是我们的系统绕过代理的Microsoft
身份验证部分。在这个特定的网络设置中绕过代理的任何东西都不能去因此,应用程序失败并显示错误"未知错误:未知错误"。



我们尝试过的关键事项



*这是app.config的system.net部分:

    < system.net>   
< defaultProxy useDefaultCredentials = " true" >
< proxy bypassonlocal = " True" usesystemdefault = " True" />
< / defaultProxy>
< /system.net>



•此< g class =" gr_ gr_32 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id =" 32" id =" 32">在< / g> app.config的bindings部分(注意bypassProxyOnLocal ="true",useDefaultWebProxy ="true"
和proxyCredentialType ="Windows"):

  < wsHttpBinding>   
< binding 名称 = " 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 = "文字" textEncoding = " utf-8" useDefaultWebProxy = " true" allowCookies = " false" >
< readerQuotas maxDepth = " 2147483647" maxStringContentLength = " 2147483647" maxArrayLength = " 2147483647" maxBytesPerRead = " 2147483647" maxNameTableCharCount = " 2147483647" />
< reliableSession 有序 = " true" inactivityTimeout = " 00:10:00" 已启用 = " false" />
< security 模式 = "消息" >
< transport clientCredentialType = " None" proxyCredentialType = " Windows" 境界 = "" />
< / security>
< / binding>
< / wsHttpBinding>








Summary: Our .NET WPF application does not seem to detect the proxy if the proxy is set to auto-discover. This means that our application fails just after it tries to authenticate with Azure AD and when we try to download the token to be used to log into the application.

However, the application loads fine if we manually define what the proxy settings are in the internet options.

i.e. when below is set to the proxy server IP.

Another interesting point is that when the proxy is set to auto-detect if we contact our services through internet explorer or chrome, we can see the WSDL.

We have a suspicion that the problem might be with the Microsoft authentication part of our system bypassing the proxy. In this particular network setup anything that bypasses the proxy cannot go past the fire, therefore, the application fails with error "Unknown error: Unknown error".

Key things we have tried

* This is the system.net part of the app.config:

  <system.net>
    <defaultProxy useDefaultCredentials="true">
      <proxy bypassonlocal="True" usesystemdefault="True" />
    </defaultProxy>
  </system.net>

• This <g class="gr_ gr_32 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id="32" id="32">in</g> the bindings section of the app.config (note that bypassProxyOnLocal="true", useDefaultWebProxy="true" and 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>


Business Analyst / Programmer Dalibor Saula

解决方案

Summary: Our .NET WPF application does not seem to detect the proxy if the proxy is set to auto-discover. This means that our application fails just after it tries to authenticate with Azure AD and when we try to download the token to be used to log into the application.

However, the application loads fine if we manually define what the proxy settings are in the internet options.

i.e. when below is set to the proxy server IP.

Another interesting point is that when the proxy is set to auto-detect if we contact our services through internet explorer or chrome, we can see the WSDL.

We have a suspicion that the problem might be with the Microsoft authentication part of our system bypassing the proxy. In this particular network setup anything that bypasses the proxy cannot go past the fire, therefore, the application fails with error "Unknown error: Unknown error".

Key things we have tried

* This is the system.net part of the app.config:

  <system.net>
    <defaultProxy useDefaultCredentials="true">
      <proxy bypassonlocal="True" usesystemdefault="True" />
    </defaultProxy>
  </system.net>

• This <g class="gr_ gr_32 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id="32" id="32">in</g> the bindings section of the app.config (note that bypassProxyOnLocal="true", useDefaultWebProxy="true" and 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>




这篇关于.NET应用程序未检测到代理 - 当代理设置为自动发现时。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆