构建错误模糊参考WCF

时间:2012-02-29 22:00:23

标签: wcf

我创建了一个wcf服务。一切都很好。现在突然添加任何逻辑我得到一个构建错误,我正在使用wcf服务说: 我有一个不明确的参考。

我可以通过将对象定为服务的一部分来解决这个问题,并且工作正常

ServiceReference1.AccountCredit=GetSomeData()

事情是页面上的所有其他对象都引用了一个objectModel dll,除了这个。

我更进一步,在浏览器中查看了服务引用本身,看到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>

我使用的所有其他对象都没有这个,反过来这是客户端抱怨的唯一对象。

1 个答案:

答案 0 :(得分:0)

可能是“MyObject”是两个不同命名空间中唯一存在的名称,其中两个命名空间都由cs文件顶部的using语句引用。