Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/262.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.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# 线程正在中止_C#_Asp.net_.net_Sql Server_Sql Server 2005 - Fatal编程技术网

C# 线程正在中止

C# 线程正在中止,c#,asp.net,.net,sql-server,sql-server-2005,C#,Asp.net,.net,Sql Server,Sql Server 2005,下面这一切到底意味着什么。我正在运行一个异步web请求,该请求调用一个向数据库发送代码的页面。然后,我的数据库触发一个运行到我的一个SQL程序集中的存储过程。大多数情况下,它是有效的,但有时我会发现: 线程正在中止 描述:执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源 异常详细信息:System.Threading.ThreadAbortException:正在中止线程 源错误: An unhandled exception was gene

下面这一切到底意味着什么。我正在运行一个异步web请求,该请求调用一个向数据库发送代码的页面。然后,我的数据库触发一个运行到我的一个SQL程序集中的存储过程。大多数情况下,它是有效的,但有时我会发现:

线程正在中止

描述:执行当前web请求期间发生未处理的异常。请查看堆栈跟踪以了解有关错误的更多信息以及错误在代码中的起源

异常详细信息:System.Threading.ThreadAbortException:正在中止线程

源错误:

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.
堆栈跟踪:

[ThreadAbortException: Thread was being aborted.]
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +486
    System.Web.ApplicationStepManager.ResumeSteps(Exception error) +501
    System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +123
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +379

出现此错误的原因很可能是您超时了。增加ExecutionTimeout,因为默认值为110秒

<compilation debug="false"></compilation>
<httpRuntime executionTimeout="1800"/> //1800 seconds / 30 minutes. 

//1800秒/30分钟。

下面是一个关于如何增加执行超时的详细说明。

应用程序域可能会被回收,这可能是由于多种原因造成的。这可能导致线程中止异常


如果进程长时间运行,IIS/ASP.Net通常不是运行它的好地方

这个错误就是他所说的。执行请求的线程正在被中止,因此您的代码将不会被执行。您需要提供更多详细信息和代码示例,以了解发生这种情况的原因。问题是我不确定代码在web应用程序或我的程序集中的确切位置?当您说大部分时间它运行良好时,需要多长时间,听起来好像它运行太慢了,或者一些资源被锁定了,所以线程执行时间达到了红线,所以.net终止了它。您可以添加原因或链接到其他信息吗?