CallSessionContext uses CallContext's GetData, SetData which won't work because after await is completed, there's another thread in the asp.net's pool which executes the code after await, so the current session is going to be null
CallContext has LogicalSetData \ LogicalGetData but I'm not sure if that's OK to use. I was hoping someone can share their experience On Tuesday, December 16, 2014 10:46:17 AM UTC+2, Ricardo Peres wrote: > > Well, that's the point: just what I said; either use CallSessionContext or > write your own. > > RP > > On Monday, December 15, 2014 11:06:27 PM UTC, Andrewz wrote: >> >> Well, that's the point, how to store that without HttpContext.Current >> >> On Monday, December 15, 2014 10:22:17 PM UTC+2, Ricardo Peres wrote: >>> >>> You need to use a context that does not store the session in a >>> thread-specific way, perhaps CallSessionContext or WebSessionContext, if >>> your WCF web service is in ASP.NET compatibility mode. Or you can write >>> your own, just inherit from CurrentSessionContext. >>> >>> RP >>> >>> >>> >>> On Monday, December 15, 2014 6:47:16 PM UTC, Andrewz wrote: >>>> >>>> I'm using a simple hybrid session context (see implementation here: >>>> http://pastebin.com/efA9efCY) >>>> >>>> This has been working fine in a .NET web-app, but I need to implement >>>> calling async code which makes HttpContext.Current unavailable after a >>>> call >>>> to 'await' completes, even if I'm in .NET 4.5 (code is running in context >>>> of a WCF service) >>>> >>>> How to I implement a new session context which works with 'await' ? >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/d/optout.
