1

I have read this thread, however unfortunately couldn't find the solution to my problem. I have an ASP.Net Core project (that's called Rent) and it works without any problem on my local machine. However, once I publish the project to the IIS (still in development mode) I get the below error

fail: Rent.Program[0]An error occured during migration 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: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details. ---> System.ComponentModel.Win32Exception (0x89C50118): Unknown error (0x89c50118)

The connection string is called DefaultConnection and is the environment variable. Can anyone help me please? Can provide any additional information if required. Environment Variable ConnectionStrings:DefaultConnection

Farid Huseynov
  • 149
  • 1
  • 11

1 Answers1

0

The first thing you should check is that your SQL Server instance is up and running and that your database is still available. This error means quite literally that it can't establish a connection to SQL Server from the Secret Server application.

And you can also check follow things in your environment:

  1. Is something blocking the connection between your Secret Server server and SQL Server?

    The standard SQL port is 1433. Check with your server administrator - is the Windows Firewall in use, blocking this port on your SQL server? Check with your network administrator - is there a firewall at some point in between that has closed off this port? Keep in mind that if you use a custom port for SQL, it need to be specified the Secret Server database connection using a SQLSERVER,port type of format.

  2. On the server hosting your SQL Server database, is the SQL Server service running?

    Open services.msc or SQL Configuration Manager to view the status of your SQL Server service.

samwu
  • 3,857
  • 3
  • 11
  • 25
  • thanks for the response, sorry it took long time before I could get back, however the problem yet has not been solved. I have switched off the firewall, I have also removed and re-installed the SQL Server 2019. Have enabled TCP/IP protocols, have also restarted the sqlserver. Unfortunately I have exactly the same error. Could you please help – Farid Huseynov Sep 26 '20 at 22:09
  • Did you view the status of your SQL Server service? – samwu Sep 29 '20 at 03:24