Two issues with NET CORE upgrade 8

by Brett Andrew 9/4/2024

We had recently been receiving quite a few errors with Azure Front Door and our integration broker, (which was running NET CORE 7):



The SSL connection could not be established, see inner exception.
With two inner exceptions
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

The issue was resolved when we upgraded our Integration Broker to NET CORE 8. We upgraded and these issues went away. But found a few other issues during the upgrade which we have documented here that might help others.

AddDistributedSqlServerCache


 services.AddDistributedSqlServerCache(options =>   {
      options.ConnectionString = tmpstring;
      options.SchemaName = "dbo";
      options.TableName = "SQLSessions8";
  });


This service stopped working and you could not save anything to session memory. We narrowed it down to this code as you could use this without any issues


services.AddDistributedMemoryCache();


But this is not a true distributed model solution, so we needed to work out why the SQL Server  Cache was not working. Eventually it came down to two major issues.

System.Data.SQLClient has now been completely replaced by Microsoft.Data.SQLClient, so you have to swap out the two.

The next issue faced was that SQL Connections that used this required us to add this to the SQL connection strings

;TrustServerCertificate=True

Without this the SQL Connection fails. You can try to just add this to your SQL Connection string to see if that corrects the sessions without having to do a full SQLClient upgrade, but in time you will need to move to the new SQLClient.


Brett Andrew

Enterprise Architect / Lead Developer / Director

Formition Pty Ltd

Contact us

popupimage

Where happiness comes naturally-copy

Formition has worked closely with Havas and Tourism Fiji to set a whole new benchmark for the Tourism industry.

Read More

Powered by mition