如何能新增Global.asax文件使我的WCF服务的一个烂摊子 [英] How can a newly added global.asax file make a mess of my WCF service

查看:1784
本文介绍了如何能新增Global.asax文件使我的WCF服务的一个烂摊子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用WCF既通过轮询双工和正常异步调用的Silverlight应用程序。一切工作正常,直到我添加了一个Global.asax文件。

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.

谷歌上搜索了一个小时后,我碰到这个相当过时的博客来过<一个href=\"http://jdstuart.word$p$pss.com/2008/10/01/polling-duplex-wcf-service-slows-down-normal-wcf-service-calls-with-aspnetcompatibility-enabled/\"相对=nofollow>,暗示注释掉掐灭在session_start事件让德克斯图尔特。

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.

果然是纠正问题,但它提出了一个问题。为什么会变成这样得体的良性Global.asax文件的成员打破了WCF调用。

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.

推荐答案

是啊,这是一个鲜为人知的,但恼人的问题。这个问题归结为会话状态,一旦你添加一个Global.asax文件到您的Web项目被启用。一旦启用会话状态,服务器将只按顺序执行的调用。这里有一些更深入的信息两篇文章:

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:

<一个href=\"http://blogs.msdn.com/b/silverlightws/archive/2009/09/30/having-a-pollingduplex-service-and-any-other-wcf-service-in-the-same-website-causes-silverlight-calls-to-be-slow.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/silverlightws/archive/2009/09/30/having-a-pollingduplex-service-and-any-other-wcf-service-in-the-same-website-causes-silverlight-calls-to-be-slow.aspx

<一个href=\"http://weblogs.asp.net/olakarlsson/archive/2010/05/20/simultaneously-calling-multiple-methods-on-a-wcf-service-from-silverlight.aspx\" rel=\"nofollow\">http://weblogs.asp.net/olakarlsson/archive/2010/05/20/simultaneously-calling-multiple-methods-on-a-wcf-service-from-silverlight.aspx

只使用浏览器网络协议栈时会发生此行为,所以你的选择是:

This behaviour only occurs when using the browser networking stack, so your options are:


  1. 在您的Web项目禁用会话状态,或

  2. 使用客户端网络协议栈

希望这有助于...

克里斯

这篇关于如何能新增Global.asax文件使我的WCF服务的一个烂摊子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆