I've got two very basic c# applications. One targeting .NET Fremework 4.7.2, the other targeting .NET 5.0. They were created at the same time, they are very simple programs that just connect to an SQL database using a connection string, perform a simple query, then disconnect.
I'm amazed at the difference in connection time between the two versions. The .net fremework 4.7 version will connect in 2.5 seconds.
The .NET 5.0 verison takes over 22 seconds to connect. Once connected the data transfer is fast enough, but the initial connection is crazy.
We even tried .NET 6.0 but got the same results.
Has anyone seen anything like this?
Here's the connection string:
connstring= "Server=servername\instancename;User Id=username;Password=***;Encrypt=false;"
SqlConnection conn = new SqlConnection(connString)
We're using System.Data.SqlClient