When will Application_EndRequest not be called?

We have an ASMX web service hosted in IIS 6 and we observe strange behavior with one of our WebMethod s. After iisreset first call to a particular method is not returned to the client, which expires after 60 seconds.

I injected logging into Application_BeginRequest and Application_EndRequest into the Global.asax.cs file. Logs show that EndRequest is not called for this call. The try-finally block in the method itself indicates that it completes.

There are other requests for various methods before, during, and after that that show no problems. TcpTrace indicates that no response is returned for this first request to the method.

The logs also show that the thread serving the request starts serving other requests after the finally block completes.

I am wondering what this behavior can cause, and how I can debug it further.

+4
source share
2 answers

Assuming this is completely repeatable, I would start by changing the method. Namely, I would delete the material until it works as expected.

There seems to be some odd secondary behavior caused by the web method itself. I guess this is a little more complicated than just adding two numbers together and returning the result.

I would also pay close attention to what this method does. For example, does it create unmanaged resources? Do you have any HTTP handlers or modules that can be destroyed the first time this method is executed?

By excluding the code until it works, you will understand exactly what causes this.

+1
source

some recommendations: put your log under: Application_AuthenticateRequest Application error and make sure you get any error.

If this does not help, check the IIS application and event event logs

0
source

All Articles