2014-12-01 37 views
4

大約一週前,我開始嘗試連接到內部WCF Web服務。我收到錯誤無法爲服務參考生成代碼

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

Unforunately的唯一其他錯誤朝着同一個基本問題指出:我的解決方案是無法打倒在WCF Web服務使用的命名空間。實際上,Reference.cs類是完全空白的,除了自動生成的評論。我在互聯網上閱讀

enter image description here

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> 
//------------------------------------------------------------------------------ 

一切都表明,我到Configure Service Reference和取消Resuse types in referenced assemblies。雖然這確實奏效,但在WCF Web服務中使用名稱空間時,它不幸造成了許多其他衝突。

我的兩個項目和網絡服務命名空間中的Mircosoft CRM SDK,當我取消了Reuse types in referenced assemblies複選框一批命名空間「模糊之處」出現(在溶液中引用的SDK DLL和Web服務的命名空間之間)。

我的問題是:有沒有一種方法來專門調試命名空間背後的原因不被從Web服務中取消?常見的解決方案看起來像是一個總體方法,並不總是診斷真正的問題。

回答

1

我有同樣的問題,並解決它

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

感謝

+0

這也適用於我。請將此標記爲已接受! – 2016-11-22 15:31:08

相關問題