签署程序集后找不到WCF方法

编程入门 行业动态 更新时间:2024-10-24 07:33:01
本文介绍了签署程序集后找不到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方法

本文发布于:2023-05-29 23:06:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/355044.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   程序   方法   WCF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!