MessageSecurityException [英] MessageSecurityException

查看:103
本文介绍了MessageSecurityException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想开发一个WCF服务和一个Client.
我也想升级它们,但不重新启动它们.
为此,我在IIS中托管了该服务.
这样,我可以更新服务-通过更改基础dll-
完美地归因于IIS托管,但如果连接了客户端,则
客户端将在下一个之后失败
称呼.然后我收到MessageSecurityException.
如果我重新启动客户端,则更新完成后可以正常工作...
有没有办法在不重新启动它们的情况下更新它们?

thx

collapo

Hi,

I''d like to develop a WCF service, and a Client.
I''d like to upgrade them also, but without restarting them.
To do this, i''ve hosted teh service in IIS.
In this way, i can update the service - by changeing the underlying dll -
flawlessly due to IIS hosting, but if a client is connected,
the client will fail after the next
call. Then i receive the MessageSecurityException.
If i restart the client, when the update finished it works fine...
Is there a way, to update them both without restarting them?

thx

collapo

推荐答案

确定.简短的回答是不,你不能".

现在,当您编译WCF服务时,它将生成.dll,并将其托管在IIS上时使用.现在请记住,.dll将始终在进程内运行.因此它将由IIS中的应用程序池执行,因为.dll无法单独执行.因此,当您更新.dll时,它将重新启动IIS上的应用程序池.

因此,您可以做的是,在客户端处理异常,然后显示带有连接丢失"消息的错误页面(通过将当前页面作为查询字符串传递)以及带有重试"的链接将再次重定向到该页面的URL,并通过查询字符串传递.

您不会经常更新WCF服务,因此我看不到任何问题.
OK. the short answer is ''No, you cannot''.

Now when you compile a WCF service, it will generate .dll, which will be used when hosted on IIS, now remember that .dll will always run inside the process. so it will be executed by the App Pool in IIS, because .dll can not execute on its own. so when you update the .dll it will restart the app pool on IIS.

so what you can do is, handle the exception on client side, and then display an error page with ''connection lost'' message (by passing a current page as query string), and a link with ''try again'' which will redirect again to that page url, passed on query string.

You are not going to update the WCF service that frequently, so I don''t see any problem with this.


这篇关于MessageSecurityException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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