Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# MVC应用程序执行超时已过期_C#_Sql Server_Connection Timeout - Fatal编程技术网

C# MVC应用程序执行超时已过期

C# MVC应用程序执行超时已过期,c#,sql-server,connection-timeout,C#,Sql Server,Connection Timeout,我收到一个错误,执行超时已过期。我已经查看了服务器探查器,没有看到任何超时事件或长持续时间。应用程序调用db来显示一个夹点,因此我认为它与连接无关。 这就是我在痕迹中看到的 RPC:正在启动exec sp_executesql SP:StmtStarting RPC:分层执行sp_重置_连接 没有结束时间,所以我不确定这是否是问题所在 为什么我会看到sp_重置连接 执行超时已过期。操作完成前已过超时时间,或者服务器没有响应。 System.Data.SqlClient.SqlException

我收到一个错误,执行超时已过期。我已经查看了服务器探查器,没有看到任何超时事件或长持续时间。应用程序调用db来显示一个夹点,因此我认为它与连接无关。 这就是我在痕迹中看到的 RPC:正在启动exec sp_executesql SP:StmtStarting RPC:分层执行sp_重置_连接 没有结束时间,所以我不确定这是否是问题所在

为什么我会看到sp_重置连接


执行超时已过期。操作完成前已过超时时间,或者服务器没有响应。
System.Data.SqlClient.SqlException
System.Data.SqlClient.TdsParser.ThroweException和System.Data.SqlClient.TdsParser.ThroweException的System.Data.SqlClient.SqlConnection.OneError(SqlException异常、布尔断开连接、操作'1 wrapCloseInAction)和System.Data.SqlClient.TdsParser.TryRun上的警告(TdsParserStateObject stateObj、布尔调用连接锁、布尔异步关闭)位于System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()的System.Data.SqlClient.SqlDataReader.TryConsumeTadata()位于System.Data.SqlClient.SqlDataReader.get_MetaData()位于System.Data.SqlClient.SqlCommand.FinishExecuteReader的(SqlDataReader ds、RunBehavior RunBehavior、String ResetOptions String、Boolean isInternal、Boolean ForDescriptionParameterEncryption、Boolean shouldCacheForAlwaysEncrypted)位于System.Data.SqlClient.SqlCommand.RunExecuteReaderDS(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、Boolean async、Int32超时、任务和任务、Boolean asyncWrite、Boolean inRetry、SqlDataReader ds、Boolean describeParameterEncryptionRequest)位于System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、String方法、TaskCompletionSource`1 completion、Int32超时、任务和任务、Boolean和usedCache、Boolean asyncWrite、Boolean inRetry)位于System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior RunBehavior、Boolean returnStream、String方法)在System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为、String方法)在System.Data.Linq.SqlClient.SqlProvider.Execute(表达式查询、QueryInfo QueryInfo、IOObjectReaderFactory、Object[]parentArgs、Object[]System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(表达式查询、QueryInfo[]QueryInfo、IOObjectReaderFactory、Object[]userArguments、ICompiledSubQuery[]subQueries、Object lastResult)在System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(表达式查询)d__1.移动下一步()
发生了一个错误。
等待操作超时
System.ComponentModel.Win32异常

这与实体框架超时命令有关,而不是像报告的异常类型那样的SQL超时

这可能是因为您的应用程序无法连接到数据库,这就是为什么您的服务器档案中没有任何内容。在档案器中超时事件是什么意思?当查询超时时,客户端API会向取消查询。这样您将在跟踪中看到一个注意事件,而不是超时。@DanGuzman我想我会看到一个锁超时事件或死锁图事件。向跟踪中添加一个注意事件。我希望在同一spid上的rpc_completed或batch_completed事件之前,该事件的持续时间将是命令超时。
<ExceptionMessage>
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
</ExceptionMessage>
<ExceptionType>System.Data.SqlClient.SqlException</ExceptionType>
<StackTrace>
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) <SendAsync>d__1.MoveNext()
</StackTrace>
<InnerException>
<Message>An error has occurred.</Message>
<ExceptionMessage>The wait operation timed out</ExceptionMessage>
<ExceptionType>System.ComponentModel.Win32Exception</ExceptionType>
<StackTrace/>
</InnerException>