签署程序集后找不到WCF方法 [英] WCF Method not found after signing an assembly

查看:92
本文介绍了签署程序集后找不到WCF方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这样的解决方案中,我有3个项目:

I have a 3 projects in a solution like such:

  • WCF服务:托管几种方法
  • 类库:通过返回其Soap客户端的实例充当WCF服务的网关
  • WPF应用程序:通过引用的类库消费服务方法

一切都运转良好...应用程序正在通过库访问soap客户端的实例,并相应地使用了方法.

Everything was working perfectly...the application was accessing an instance of the soap client through the library and consuming the methods accordingly.

现在,我对程序集进行签名,并且所有内容仍然可以编译,当我添加新方法并更新库中的服务引用时,新方法将出现在应用程序中...但是在运行该应用程序并尝试使用某个方法时,抛出MissingMethodException:

Now I signed my assemblies and everything still compiles and when I add new methods and update the service reference in the library, the new methods come up in the application...but when running the application and try to use a method, a MissingMethodException is thrown:

找不到方法: 'MusicData.Entities.User DBAccess_Gateway.DBInteraction_Service.DBInteractionGatewayClient.User_Login(System.String, System.String)".

Method not found: 'MusicData.Entities.User DBAccess_Gateway.DBInteraction_Service.DBInteractionGatewayClient.User_Login(System.String, System.String)'.

这是其失败的行:

 var user = WSGateway.MR_WebService.User_Login(username.Text, crypto.Encrypt(passphrase.Password));

我认为这与程序集(由于它们已经签名而现在位于gac中)有关.但是为什么没有找到方法呢?签名的程序集现在不能正确更新吗?

I think it has something to do with the assemblies (now in the gac because they are signed?) being signed...but why arent the methods are not being found? Are the signed assemblies not being updated correctly now?

推荐答案

在类库中更新服务引用时,请确保您正在创建程序集的新版本并在GAC中注册该新版本,然后进行确保您的WPF应用正在引用此新版本.

When you update the service references in your class library, make sure you are creating a new version of the assembly and registering this new version in the GAC, then make sure your WPF app is referencing this new version.

这篇关于签署程序集后找不到WCF方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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