ASP.NET / WCF - Execute Server.Execute Asynchronously

Posted by user208662 on Stack Overflow See other posts from Stack Overflow or by user208662
Published on 2010-03-30T16:04:51Z Indexed on 2010/04/02 2:53 UTC
Read the original article Hit count: 505

Filed under:
|

Hello,

I need to run the HttpContext.Current.Server.Execute method in my ASP.NET application. This application has a WCF operation that does some processing. Currently, I am to do my processing correctly from within my WCF operation. However, I would like to do this asynchronously.

In an error to attempt this asynchronously, I tried running Server.Execute in the DoWork event handler of a BackgroundWorker. Unfortunately, this throws an error that says

"object reference not set to an instance of an object"

The HttpContext element is not null. I checked that. It is some property nested in the HttpContext object that appears to be null. However, I have not been able to identify why this won't work. It happens as soon as I move the processing to the BackgroundWorker thread.

My question is, how can I asynchronously execute the Server.Execute method?

Thank you,

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about wcf