I am using Microsoft.EntityFrameworkCore
(version 3.1.30) in a .NET Framework 4.8 WPF application to access a remote SQL Server 2016 Express.
On a specific instance I get this error:
Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: HTTP Provider, error: 0 - )
The connection string is specified with IP address (not a named instance) and Trust server certificates = True
I can successfully connect if I manually specify the tcp:
protocol before IP address
Why does SqlClient
try to select HTTP Provider in this case?