Я создал веб-сервис WCF, который я хочу использовать. На моем клиенте я добавил новую ссылку на сервис. Он находит его, я даю ему пространство имен и нажимаю ОК. Он генерирует соответствующий код, но когда я перестраиваю приложение, я получаю сообщение об ошибке:
Circular base class dependency involving 'WSHelperClient' and 'WSHelperClient'
Вот автоматически сгенерированный код. Если я заменю "WSHelperClient.WSHelper." с помощью "" он исправляет ошибку зависимости базового класса Circular.
Кто-нибудь знает, почему автоматически сгенерированный код не компилируется, и мне нужно изменить его вручную?
namespace WSHelperClient.WSHelper {
using System.Runtime.Serialization;
using System;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="PowerShellResponse", Namespace="http://schemas.datacontract.org/2004/07/WSHelper")]
[System.SerializableAttribute()]
public partial class PowerShellResponse : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
[System.NonSerializedAttribute()]
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string DescriptionField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private bool HadErrorsField;
[global::System.ComponentModel.BrowsableAttribute(false)]
public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
get {
return this.extensionDataField;
}
set {
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string Description {
get {
return this.DescriptionField;
}
set {
if ((object.ReferenceEquals(this.DescriptionField, value) != true)) {
this.DescriptionField = value;
this.RaisePropertyChanged("Description");
}
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public bool HadErrors {
get {
return this.HadErrorsField;
}
set {
if ((this.HadErrorsField.Equals(value) != true)) {
this.HadErrorsField = value;
this.RaisePropertyChanged("HadErrors");
}
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="WSHelper.IWSHelper")]
public interface IWSHelper {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWSHelper/ConvertUserMailboxToShared", ReplyAction="http://tempuri.org/IWSHelper/ConvertUserMailboxToSharedResponse")]
WSHelperClient.WSHelper.PowerShellResponse ConvertUserMailboxToShared(string email);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWSHelper/ConvertUserMailboxToShared", ReplyAction="http://tempuri.org/IWSHelper/ConvertUserMailboxToSharedResponse")]
System.Threading.Tasks.Task<WSHelperClient.WSHelper.PowerShellResponse> ConvertUserMailboxToSharedAsync(string email);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWSHelper/RemoveUserLicences", ReplyAction="http://tempuri.org/IWSHelper/RemoveUserLicencesResponse")]
WSHelperClient.WSHelper.PowerShellResponse RemoveUserLicences(string upn);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWSHelper/RemoveUserLicences", ReplyAction="http://tempuri.org/IWSHelper/RemoveUserLicencesResponse")]
System.Threading.Tasks.Task<WSHelperClient.WSHelper.PowerShellResponse> RemoveUserLicencesAsync(string upn);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWSHelper/RemoveMailboxFromAddressBook", ReplyAction="http://tempuri.org/IWSHelper/RemoveMailboxFromAddressBookResponse")]
WSHelperClient.WSHelper.PowerShellResponse RemoveMailboxFromAddressBook(string email);
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IWSHelper/RemoveMailboxFromAddressBook", ReplyAction="http://tempuri.org/IWSHelper/RemoveMailboxFromAddressBookResponse")]
System.Threading.Tasks.Task<WSHelperClient.WSHelper.PowerShellResponse> RemoveMailboxFromAddressBookAsync(string email);
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface IWSHelperChannel : WSHelperClient.WSHelper.IWSHelper, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class WSHelperClient : System.ServiceModel.ClientBase<WSHelperClient.WSHelper.IWSHelper>, WSHelperClient.WSHelper.IWSHelper {
public WSHelperClient() {
}
public WSHelperClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public WSHelperClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public WSHelperClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public WSHelperClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
public WSHelperClient.WSHelper.PowerShellResponse ConvertUserMailboxToShared(string email) {
return base.Channel.ConvertUserMailboxToShared(email);
}
public System.Threading.Tasks.Task<WSHelperClient.WSHelper.PowerShellResponse> ConvertUserMailboxToSharedAsync(string email) {
return base.Channel.ConvertUserMailboxToSharedAsync(email);
}
public WSHelperClient.WSHelper.PowerShellResponse RemoveUserLicences(string upn) {
return base.Channel.RemoveUserLicences(upn);
}
public System.Threading.Tasks.Task<WSHelperClient.WSHelper.PowerShellResponse> RemoveUserLicencesAsync(string upn) {
return base.Channel.RemoveUserLicencesAsync(upn);
}
public WSHelperClient.WSHelper.PowerShellResponse RemoveMailboxFromAddressBook(string email) {
return base.Channel.RemoveMailboxFromAddressBook(email);
}
public System.Threading.Tasks.Task<WSHelperClient.WSHelper.PowerShellResponse> RemoveMailboxFromAddressBookAsync(string email) {
return base.Channel.RemoveMailboxFromAddressBookAsync(email);
}
}
}