System.Net.Sockets.SocketException (0x80004005) 应用账号注销时

System.Net.Sockets.SocketException (0x80004005) when the application account is logged off

我有一个 SQL 服务器代理作业,它执行存储在 SSISDB 中的 SSIS 包。其中一项任务是执行控制台应用程序。控制台应用程序与组织外部托管的 Web 服务连接。该作业的任务配置了一个代理帐户,该代理帐户是一个域帐户。

作业运行良好,可以手动执行,也可以在代理(域)帐户登录到托管作业和包的服务器时按计划执行。

但是当代理账户注销时,控制台应用程序抛出以下错误:

Inner exception :: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 109.205.54.105:443 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

代理帐户在本地管理员组中。我尝试将帐户添加到分布式 COM 用户,但这没有帮助。拥有 Web 服务的供应商表示日志中没有任何问题。

导致此错误的原因是什么?如何解决?非常感谢你的帮助。

更新

我已经与安全团队核实过,似乎当应用程序登录时,流量会通过代理。应用账号注销后,直接打到防火墙掉线

到目前为止我尝试过但没有帮助的事情:

导致错误的事情:

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

.NET 运行时

Application: iPersonel.SendData.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Configuration.ConfigurationErrorsException at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(System.Configuration.ConfigurationSchemaErrors) at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() at System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)

Exception Info: System.Configuration.ConfigurationErrorsException at System.Configuration.ClientConfigurationSystem.EnsureInit(System.String) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(System.String) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String) at System.Configuration.ConfigurationManager.get_AppSettings() at SendData.Log.Logger..cctor()

Exception Info: System.TypeInitializationException at SendData.Log.Logger.GetOrRegister() at SendData.Program.Main(System.String[])

应用程序错误

Faulting application name: iPersonel.SendData.exe, version: 1.0.0.0, time stamp: 0xad1edd6c Faulting module name: KERNELBASE.dll, version: 10.0.17763.2028, time stamp: 0xc13cbc1f Exception code: 0xe0434352 Fault offset: 0x00123522 Faulting process id: 0x25f4 Faulting application start time: 0x01d788539cbe6d32 Faulting application path: D:\PLPayrollInterface\ConsoleApp\iPersonel.SendData.exe Faulting module path: C:\Windows\System32\KERNELBASE.dll Report Id: a2658be2-a18b-417f-ba29-6c525332b0cd Faulting package full name: Faulting package-relative application ID:

.NET 运行时错误是否表明 app.config 文件中有问题?项目编译没有错误。

在配置文件 <basicHttpBinding> 下添加 2 个属性:useDefaultWebProxy 和 proxyAddress 解决了问题。

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="AuthenticationUrl" useDefaultWebProxy="false" proxyAddress="URI">
      <security mode="Transport" />
    </binding>
  </basicHttpBinding>
</bindings></system.serviceModel>