In my appsettings.json, when I use this snippet:
"ConnectionStrings": {
"CssDatabase": "Server=BLUEJAY\MSSQLSERVER2014;Database=CSS;Trusted_Connection=True;"
}
I can connect to the db as expected... no issues.
However, when I change that to use the SQL Alias (CSSDB), like so:
"ConnectionStrings": {
"CssDatabase": "Server=CSSDB;Database=CSS;Trusted_Connection=True;"
}
It is properly configured since I can use this SQL Alias in SSMS to connect to DB without an issue.
This returns:
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: Named Pipes Provider, error: 40 -
Could not open a connection to SQL Server) --->
System.ComponentModel.Win32Exception: The network path was not found
I am using Microsoft.EntityFrameworkCore
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…