添加WCF服务引用失败解决办法

最近在玩SL4 beta,写了一个WCF的服务,在Silverlight Application中选择Add Service Reference,填入服务地址,但在生成服务引用代码(应该就是代理类)时发生错误:Error 7 Custom tool error: Failed to generate code for the service reference ‘xxx’. Please check other error and warning messages for details…进到Service References文件夹一看确实没有生产代码,Update Service Reference, 甚至删了重新添加也没有用。检查WCF服务也没有问题。而使用svcutil工具则能正常生成,但svcutil生成的引用代码却不能在SL中使用。

于是Google之,网上各种解决方法不能奏效,最后在此处找到强帖,关键内容如下:"Ok...Weird.  Closed the project and all other projects open.  Restarted the web service.  Reopened the project.  Deleted the reference to the web service.  Readded it.  All was fine and now it works." 简单地说,就是:把VS关了再开。试了一下,果然可以。

在Microsoft Connect上已有人提交此bug。微软的回复是:"Thank you for reporting the issue. This issue has been resolved in the latest version of VS2010. " 然而此回复的日期是11月16日,而我现在用的VS2010 beta2 依然有此问题。

posted on 2009-12-17 00:38  Gildor Wang  阅读(1241)  评论(0编辑  收藏  举报

导航