更新服务参考不起作用 [英] Update service reference not working

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

问题描述

我使用的是 Visual Studio 2008 并且有一个 WCF 客户端处理 WCF 服务.它们都位于同一个 Visual Studio 解决方案中.在我对 WCF 合同进行更改后,我想更新客户端上的服务引用,以便对合同所做的更改也在代理中进行.

I'm using Visual Studio 2008 and have a WCF client working against a WCF service. They are both located in the same Visual Studio solution. After I've made a change in my WCF contract, I want to update the service reference on the client so that changes made to the contract is also made in the proxy.

我的问题是代理代码没有重新生成.

My problem is that the proxy code is not re-generated.

当我选择更新服务引用时,会发生以下情况:

When I select to update the service reference, the following happens:

  1. 显示标题为更新服务引用'name-of-reference'"的对话框.此对话框有一个进度条.
  2. 进度条移动,对话框中的状态文本更改为正在更新配置"
  3. 进度条移动了一点,状态文本更改为配置更新完成"

对话框没有显示我期望的文本Generating \something\"(不记得确切的措辞).

The dialog doesn't show the text "Generating \something\" (can't remember the exact wording) which I would expedct.

如果我删除服务引用并再次添加,则正确生成代理.我使用与之前完全相同的设置添加服务,因此我认为这不是我可以通过更改客户端上的服务引用配置来解决的问题.

If I delete the service reference and add it again, the proxy is properly generated. I add the service using the exact same settings as before, so I don't think it's a issue I can solve by changing the service reference configuration on the client.

我怀疑可能是问题的一件事是我在 app.config 中重命名了默认的 wsHttpBindings.我还重命名了默认端点.这背后的原因是我需要多个端点,并且有一个名为some-default-name"的端点和一个具有我自己名字的端点只是令人困惑.

One thing I suspect may be the problem is that I've renamed the default wsHttpBindings in app.config. I've also renamed the default endpoints. The reason behind this is that I need more than one endpoint and having one named 'some-default-name' and one with my own name is just confusing.

删除服务并再次添加的问题是 Visual Studio 在 app.config(以及其他内容)中添加了一个不应该存在的新绑定.

The problem with deleting the service and adding it again is that Visual Studio adds a new binding in app.config (among other things) which should not be there.

有人见过这个问题吗?有人知道解决方法吗?

Anyone seen this problem before? Anyone knows of a solution to it?

推荐答案

当我们遇到这个问题时,通常是以下错误之一:

When we have had this problem it has usually been one of these errors:

  • 合同的大小已经增加,现在已经很大,WCF 配置不允许它被转移.
  • 一个新类已添加到 WCF 接口,并且该类未标记为可序列化.
  • 有一个编译错误导致代码无法构建,因此它使用旧的 dll

这篇关于更新服务参考不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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