Wcf服务调用一次但运行多次 [英] Wcf service Called once but runs multiple times

查看:76
本文介绍了Wcf服务调用一次但运行多次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

我有一个奇怪的问题。

我有一个使用wcf服务的silverlight 3应用程序。我打电话给网络服务一次,但它运行了6次,我也得到了6次完整的试用。

I have a silverlight 3 application that uses a wcf service. I call the webservice once but it runs 6 times and I also get a completedevent 6 times.

我可以在网络服务的开头设置一个断点,看它被调用6次。而现在它变得更加陌生。当我在我的应用程序中设置一个断点时,该服务被调用它运行完美(只需一次),但当我删除该断点
时,wcf服务将再次运行6次。所以调试很难。

I can set a breakpoint a the beginning of the webservice to see it get called 6 times. And now it gets even stranger. when I set a breakpoint in my application at the point where the service is called it runs perfect (just once), but when I remove that breakpoint the wcf service will run 6 times again. So debugging is hard.

有没有人知道问题是什么。

Does anybody have a clue to what the problem is.

推荐答案

我的猜测是你要添加一个新的事件处理程序而不删除旧的事件处理程序。 第一次调用服务时,已完成的事件被调用一次,第二次被调用两次,等等

My guess is that you are adding a new event handler without removing the old one.  The first time you call the service the completed event is called once, the second time it is called twice, etc 


这篇关于Wcf服务调用一次但运行多次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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