I have a silverlight app that uses WCF both by polling Duplex and “normal” async calls. everything was working fine, until I added a global.asax file.
After an hour of googling, I came across this rather dated blog by Jean-Dirk Stuart that suggested commenting out the stubbed Session_start event.
Sure enough that corrected the problem, but it raises a concern. Why would this seemly benign member of the global.asax file break the wcf calls.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Yeah, this is a little known but annoying issue. The problem comes down to session state being enabled once you add a global.asax file to your web project. Once session state is enabled, the server will only execute the calls sequentially. Here are two articles with some more in-depth information:
This behaviour only occurs when using the browser networking stack, so your options are:
- Disable session state in your web project, or
- Use the client networking stack
Hope this helps…
Chris
Method 2
There are some types of binding which support accessing asp.net session data, I really dont see how it would affect unless WCF tries to hook into the session_start event just like a http module does. You could also use reflector to disassemble the code where you where getting the exception.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0