Why am I getting quot;Thread was being abortedquot; in ASP.NET?(为什么我得到“线程被中止?在 ASP.NET 中?)
问题描述
我不确定为什么会发生这种情况,而且我从未明确中止线程,所以这有点令人惊讶.但是我记录了异常并且我看到了:
I am not sure why this happens and I never explicitly abort threads, so it's a bit of a surprise. But I log Exceptions and I am seeing:
System.Threading.ThreadAbortException - 线程被中止.
System.Threading.ThreadAbortException - Thread was being aborted.
这似乎发生在对 System.Threading.WaitHandle.WaitOne 的调用中.我不确定这个异常能走多远.我认为我的线程永远不会终止,因为我会捕获日志并吞下错误.
It appears to happen in a call to System.Threading.WaitHandle.WaitOne. I am not sure how far this Exception goes. I don't think my threads ever terminate, because I catch log and swallow the error.
为什么会出现这些错误?也许是当我强行终止我的服务器或要求它重新启动时?如果不是,那可能是什么原因造成的?
Why am I getting these errors? Perhaps it's when I am forcefully terminating my server or asking it to reboot? If it isn't then what might be causing them?
推荐答案
不,ThreadAbortException 是由一个简单的 Response.Redirect
Nope, ThreadAbortException is thrown by a simple Response.Redirect
这篇关于为什么我得到“线程被中止"?在 ASP.NET 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么我得到“线程被中止"?在 ASP.NET 中?
基础教程推荐
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- WPF 模态进度窗口 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
