当ASP.NET System.Web.Htt presponse.End()被调用,当前线程被中止? [英] When an ASP.NET System.Web.HttpResponse.End() is called, the current thread is aborted?

查看:729
本文介绍了当ASP.NET System.Web.Htt presponse.End()被调用,当前线程被中止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在System.Web.Htt presponse.End()被调用时被解雇一个System.Thread.Abort,我猜是(或火灾)的异常?我有一些记录,这是在日志文件中被列...

when a System.Web.HttpResponse.End() is called a System.Thread.Abort is being fired, which i'm guessing is (or fires) an exception? I've got some logging and this is being listed in the log file...

第一次机会。

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

这是正常的行为,并有可能中止优雅,而不是(什么样子)突然中止突然?

Is this normal behavior and is it possible to gracefully abort instead of (what looks like) a sudden abrupt abort?

到目前为止,它的共同人口普查,它设计的 。所以我不知道如果有可能,我们可以利用这个问题,看看我们是否可以捏捏code,使其不觉得我们结束线程的 prematurely 的优雅地退出......可能吗? code的例子吗?

So far it the common census that it's by design. So i'm wondering if it's possible we could take this question and see if we could tweak the code to make it not feel like we're ending the thread prematurely and gracefully exit ... Possible? Code examples?

推荐答案

是的,这的确是由设计。微软甚至记录的吧。你怎么回事将从停止执行程序的其他部分?

Yes, this is indeed by design. Microsoft has even documented it. How else would you stop the rest of your program from execution?

这篇关于当ASP.NET System.Web.Htt presponse.End()被调用,当前线程被中止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆