WCF更新服务引用会破坏现有代码

问题描述 投票:2回答:1

我有一个长期使用的类库项目,有.NET框架4。它有一些wcf服务引用(由不同的团队管理),我们有一个数据源文件 "System.Xml.XmlElement.datasource "在 "Properties->DataSources "下,它有以下配置。

<?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="XmlElement" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>System.Xml.XmlElement, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=h73c5g561921f068</TypeInfo>
</GenericObjectDataSource>

其中一个服务有一些新的功能,于是我右键点击服务引用,进入configure指向更新服务url,更新了引用。

现在DataSource文件夹里多了一些数据源文件,好像是datacontracts。而且不幸运的是,一些现有的数据合同现在不见了。然而,当我将同样的引用添加到一个虚拟的web项目中时,我能够从服务中访问所有的类和类型,并成功地构建项目,并且逻辑也在那里正常工作。

请帮我解决这个问题。

c# wcf wcf-binding
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.