none
Upgrading .NET Framework to 4.6.1 results in socket exceptions. RRS feed

  • Question

  • Initially my project was on .NET framework 4.5 and then I migrated it to .NET framework 4.6.1 And Now, I am getting Socket Exceptions which was not there earlier with .NET 4.5

    My project contains one application which is used for logging messages. And there are several services for processing Cashflows. So, when I start the logging application (runs on port no 4041), the service running on port no. 4040 gets stop. this issue is coming when I upgraded .NET framework to 4.6.1 

    Error message as:

    Inner Exception --------------- Type : System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9900000'.

    Inner Exception --------------- Type : System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : An existing connection was forcibly closed by the remote host


    Can anyone please tell, how .NET framework upgrade is affecting it and what should be the solution?

    Monday, July 29, 2019 3:35 PM

All replies

  • Hi,

    Which binding we use in your project, and which security mode we use in the binding? The Dotnetframwork runtime will affect the TLS communication (http and ssl), which means that the https communication established between the server and client requires DotNet framework and OS support.
    https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls
    We could manually specify the TLS version that https communication use.

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

    Feel free to let me know if the problem still exists.
    Best Regards
    Abraham

    Tuesday, July 30, 2019 4:19 AM
    Moderator