MVC3部署到主机-现在工作了16天SQL错误

本文关键字:工作 16天 SQL 错误 部署 主机 MVC3 | 更新日期: 2023-09-27 17:49:14

我已经构建了一个mvc应用程序并将其部署到第三方主机上。经过一些严重的摆弄连接字符串和类似我终于设法让它连接到主机上的SQL DB和应用程序运行良好,允许MVC的所有铃声和口哨工作(添加,更新,删除等)。

我离开网站运行了两个星期左右(使没有任何变化),现在当我浏览到它,我得到以下错误(当自定义错误关闭)。

> Server Error in '/' Application.
> 
> 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)
> 
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code. 
> 
> Exception Details: System.Data.SqlClient.SqlException: 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)
> 
> Source Error: 
> 
> An unhandled exception was generated during the execution of the
> current web request. Information regarding the origin and location of
> the exception can be identified using the exception stack trace below.

我知道这是一个问题连接到SQL数据库,但我想知道的是为什么两周后运行它发生了?如果我修复它,它会再次发生在另一个两周后?

欢呼。

MVC3部署到主机-现在工作了16天SQL错误

如果它已成功部署并运行了2周。您的主机提供商端一定有问题。您可以在您的主机提供商的支持系统上打开一个票。

下载副本并在本地环境中进行某些更改(db字符串等)并检查是否一切正常。

我相信,这是托管提供商的问题。