Home » Development » How to configure timeout value in ASP.NET project and stay away from “ThreadAbortException”

How to configure timeout value in ASP.NET project and stay away from “ThreadAbortException”

You may run into this error message in your ASP.NET project:

System.Threading.ThreadAbortException: Thread was being aborted.

It means that executing some part of your code took time more than it is allowed. You can trace the stack to see which lines they are. If you trust your code, it is a good idea to increase timeout value so the thread won’t aborted again.

Resolution

Add this code or change it if it’s already exist in your web.config file:

<system.web>
     <httpRuntime targetFramework="4.5" executionTimeout="360000" maxUrlLength="10000" maxQueryStringLength="80000" />
</system.web>

Ned Sahin

Blogger for 20 years. Former Microsoft Engineer. Author of six books. I love creating helpful content and sharing with the world. Reach me out for any questions or feedback.

1 thought on “How to configure timeout value in ASP.NET project and stay away from “ThreadAbortException””

Leave a Comment