System.Data.SqlClient.SqlException
Fehlermeldung in Asp.Net Core 2 Log:
fail: Microsoft.EntityFrameworkCore.Database.Connection[20004] An error occurred using the connection to database 'readdy' on server '.\SQLEXPRESS'. System.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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) ..
ClientConnectionId:00000000-0000-0000-0000-000000000000 Error Number:-1,State:0,Class:20 fail: Microsoft.EntityFrameworkCore.Database.Connection[20004] An error occurred using the connection to database 'readdy' on server '.\SQLEXPRESS'. System.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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen() |
Ursache:
Der SQL Connectionstring Parameter MultiSubnetFailover war auf true gesetzt
public static string Connectionstring = "Data Source=.\\SQLEXPRESS;Initial Catalog=readdy;Integrated Security=True;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=true"; |
LΓΆsung
public static string Connectionstring = "Data Source=.\\SQLEXPRESS;Initial Catalog=readdy;Integrated Security=True;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=false"; |