Update-database shows 'provider: SNI_PN11, error: 26 - Error Locating Server/Instance Specified' error

update-database after adding migration on package manager console of Visual studio 2022 brings the following error:

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: SNI_PN11, error: 26 - Error Locating Server/Instance Specified)

My database is in SQL server management studio 18. And I have already created the database there. Now I want to connect it with Visual Studio. Here is my connection code on appsettings.json:

"Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "DevConnection": "Server =(local)\\sqlexpress; Database=TiloshDesetDatabase; Trusted_Connection=True; MultipleActiveResultSets=True;"
  }
}

I have successfully added the migration but I don’t know why updating the database doesn’t work. Please help!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.