When error The network path was not found displays, make note of the details of the timeout in the yellow area of the error message. In this example, the following details are displayed in the yellow area of the error message: 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.
Notice the error identifies SQL Exception 0x80131904.
If you are using a hosting provider, contact the hosting provider to determine if the hosting providers SQL Server is having issues. If this error only occurs intermittently, there certainly is not a problem with the code of your application, and there is indeed some issues along the path or with the SQL Server.
If you control SQL Server, ensure TCP/IP, port 1433, and Named Pipes are enabled.
- Select the Windows Start icon, type mmc.exe in search, and select mmc.exe.
- In the Console, press Ctrl + M (or select File > Add/Remove Snap In).
- Move the SQL Server Configuration Manager to Selected snap-ins and select OK.
- Expand SQL Server Configuration Manager > SQL Server Network Configuration > Protocols for instance_name.
- Right-click on Named Pipes and select Enable.
- Right-click on TCP/IP and select Enable.
- Right-click on TCP/IP, select Properties, and make the following adjustments:
- Ensure the IP address matches the IP address of your SQL Server
- Ensure Port number 1433 is listed
- Restart the PC.
If you are using Visual Studio to create an ASP.NET application, ensure there is only one connection string in the web.config file. Notice in this example there are 6 connection strings in the web.config file. You would want to eliminate all but one of the connection strings.
It is also helpful to ensure you list the public IP address followed by the Port in the connection string.
Delete the Migrations folder and files under the Migrations folder.