加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 无法生成服务引用代码

发布时间:2020-12-15 22:09:59 所属栏目:百科 来源:网络整理
导读:大约一周前,我开始尝试连接到内部WCF Web服务.我收到了错误 Custom tool error: Failed to generate code for the service reference ‘DynamicsCom’. Please check other error and warning messages for details. 不幸的是,唯一的其他错误指向同一个基本
大约一周前,我开始尝试连接到内部WCF Web服务.我收到了错误

Custom tool error: Failed to generate code for the service reference ‘DynamicsCom’. Please check other error and warning messages for details.

不幸的是,唯一的其他错误指向同一个基本问题:我的解决方案无法降低WCF Web服务使用的命名空间.实际上,除了自动生成的注释外,Reference.cs类完全空白.

Reference.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18063
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

我在互联网上阅读的所有内容都表明我必须配置服务引用并取消选中引用程序集中的Resuse类型.虽然这确实有效,但在降低WCF Web服务中使用的命名空间时,它不幸会产生许多其他冲突.

我的项目和Web服务名称空间都使用Mircosoft CRM SDK,当我取消选中引用程序集中的重用类型复选框时,会出现许多名称空间“歧义”(在解决方案中引用的SDK dll和Web服务名称空间之间).

我的问题是:有没有办法专门调试命名空间背后的原因而不是从Web服务中删除?常见的解决方案似乎是一种全面的方法,并不总能诊断出真正的问题.

解决方法

我有同样的问题,并解决如下

1 . Remove DynamicsCom from your service refernces

2 . Clean the solution

3 . Re add service reference and give the same name “DynamicsCom”

4 . Right Click on DynamicsCom and go to Configure Service References

5 . Re Build the solution,it should work fine now

谢谢

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读