gpt4 book ai didi

asp.net - 当调用ASP.NET System.Web.HttpResponse.End()时,当前线程是否中止?

转载 作者:行者123 更新时间:2023-12-03 13:31:37 28 4
gpt4 key购买 nike

当System.Web.HttpResponse.End()被称为System.Thread.Abort被触发时,我猜这是(或触发)异常?我有一些日志记录,并且正在日志文件中列出...

第一次机会

exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
12/14/2008 01:09:31::
Error in Path :/authenticate
Raw Url :/authenticate
Message :Thread was being aborted.
Source :mscorlib
Stack Trace : at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at DotNetOpenId.Response.Send()
at DotNetOpenId.RelyingParty.AuthenticationRequest.RedirectToProvider()
at MyProject.Services.Authentication.OpenIdAuthenticationService.GetOpenIdPersonaDetails(Uri serviceUri) in C:\Users\Pure Krome\Documents\Visual Studio 2008\Projects\MyProject\Projects\Services\Authentication\OpenIdAuthenticationService.cs:line 108
at MyProject.Mvc.Controllers.AuthenticationController.Authenticate() in C:\Users\Pure Krome\Documents\Visual Studio 2008\Projects\MyProject\Projects\MVC Application\Controllers\AuthenticationController.cs:line 69
TargetSite :Void AbortInternal()
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in Ackbar.Mvc.DLL
An exception of type 'System.Threading.ThreadAbortException' occurred in Ackbar.Mvc.DLL but was not handled in user code


这是正常现象吗?是否可以正常地中止而不是突然的中止?

更新资料

到目前为止,它是 by design的普遍普查。所以我想知道是否有可能我们提出这个问题,看看是否可以调整代码以使我们不觉得自己正在过早地结束线程并优雅地退出...可能吗?代码示例?

最佳答案

是的,这确实是设计使然。微软甚至有documented它。您还如何阻止程序的其余部分执行?

关于asp.net - 当调用ASP.NET System.Web.HttpResponse.End()时,当前线程是否中止?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/365249/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com