views:

255

answers:

2

Hi folks,

I have an ASP.NET program which is launching this exception, apparently randomly. I've seen other questions about this exceptions, and everyone says that's a problem of Response.Redirect. However, I'm not using a Response.Redirect call neither a Response.End, so I have no idea what's happening here.

However, I have a supposition: This program is receiving a lot of data, it can be processing data even 3 or 4 minutes, or even more. Could it be that internally, something is closing the connection or something like that because of that?

Thanks a lot in advance!!

A: 

Possibly you are hitting the Script timeout which results in the same ThreadAbortException.

If you need to extend the processing time allowed use:-

Server.ScriptTimeout = 900 // Time allowed in seconds
AnthonyWJones
It seems to be a good solution, but where do I have to write it? Because the exception happens in random classes...
Roman
You would put it in the ASPX/Ashx that kicks off a long running task. You would not want to have many of these right?
AnthonyWJones
It's not a web page, it's a web service, so I don't have an aspx file :(. I mean, I have a web page with a web service included in a dll, and the web service is the one that receive the data and the one that use so much time
Roman
You should still be able to get at the ScriptTimeout via HttpContext.Current.Server
AnthonyWJones
A: 

Try the executionTimeout in the web.config, refer to

http://msdn.microsoft.com/en-us/library/e1f13641.aspx

If your on IIS6+, check the application pool setting and ensure it doesnt Timeout. It could be the ping issue, that it the thread become unresponsive during execution and IIS shutsdown the Application Pool. Turn Ping Enabled to off.

Jason Jong