2012-02-29 18 views
0

我創建了一個WCF服務。一切工作正常。現在突然添加任何邏輯,我得到一個構建錯誤,我正在使用wcf服務說: 我有一個模糊的參考。生成錯誤不明確的引用WCF

我可以qualifiing對象作爲服務的一部分解決這個問題,它工作正常

ServiceReference1.AccountCredit=GetSomeData() 

的事情是頁面上的所有其他你的對象引用的DLL objectModel除了這一個。

我走得更遠,並在瀏覽器中查看服務引用本身並請參見Visual Studio此特定對象上無論是什麼原因增加了一個文件,其中包含以下內容:

<?xml version="1.0" encoding="utf-8" ?> 
- <!-- 
    This file is automatically generated by Visual Studio .Net. It is 
    used to store generic object data source configuration information. 
    Renaming the file extension or editing the content of this file may 
    cause the file to be unrecognizable by the program. 


    --> 
- <GenericObjectDataSource DisplayName="AccountCredit" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> 
    <TypeInfo>TestMethods.ServiceReference1.AccountCredit, Service References.ServiceReference1.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> 
    </GenericObjectDataSource> 

所有其他的我用不要有這個對象而這又是客戶抱怨的唯一對象。

回答

0

這可能是「MyObject來」是存在於兩個不同的命名空間,其中兩個命名空間是通過using語句在CS文件的頂部引用的唯一名字。

+0

我將如何看到或解決這個問題?代碼應該讀取ServiceReference1.AccountCredit = GetSomeData()抱歉 – 2012-03-01 17:39:13