OperationContext.Current is null and all other contexts too

Posted by HeavyWave on Stack Overflow See other posts from Stack Overflow or by HeavyWave
Published on 2010-05-19T01:52:49Z Indexed on 2010/05/19 2:00 UTC
Read the original article Hit count: 382

Filed under:
|

I have a WCF service defined as following:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.PerCall)]
public partial class FrontEndService : IFrontEndService

However, most of the time (but not always -_-) InstanceContext.Current is null, as well as HttpContext.Current and OperationContext.Current is also null.

What am I missing? What I want to do is store some data in HttpContext.Current.Items or a similar collection that exists for the length of the request.

© Stack Overflow or respective owner

Related posts about wcf

Related posts about httpcontext