Response.End和Response.Redirect

时间:2015-08-06 20:52:04

标签: windows-10 threadabortexception

将我的开发计算机升级到Windows 10后,无论何时调用Response.End或Response.Redirect,我的ASP.NET应用程序都开始提供ThreadAbortException。

我从研究中了解到这是预期的,你可以调用其他功能而不会引起错误。但是在升级到Windows 10之前我从来没有处理过这个错误。以前我用.NET 4.52运行Windows 8.1而Windows 10现在是.NET 4.6所以我认为它与它有关。所以问题是为什么它刚刚开始抛出异常并且有一种方法可以在不转换代码的情况下停止它。

Thread was being aborted.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Threading.ThreadAbortException: Thread was being aborted.

Source Error: 

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.

Stack Trace: 


[ThreadAbortException: Thread was being aborted.]
   System.Runtime.InteropServices.GCHandle.InternalFree(IntPtr handle) +0
   System.Runtime.InteropServices.GCHandle.Free() +77
   System.Web.Util.GCUtil.UnrootObject(IntPtr pointer) +65
   System.Web.ApplicationStepManager.ResumeSteps(Exception error) +687
   System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +247
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +647

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.79.0

1 个答案:

答案 0 :(得分:1)

Microsoft已在.NET Framework 4.6中承认此错误: https://connect.microsoft.com/VisualStudio/feedback/details/1605438/disabling-ryujit-breaks-asp-net 你可以尝试一些事情:

  • 从注册表中删除UseLegacyJIT值
  • 卸载Windows更新3083186