小编edu*_*bbs的帖子

ClientBase不实现IDisposable成员

如果Dispose()方法声明不可见/声明,System.ServiceModel.ClientBase抽象类如何实现IDisposable接口?

如果我尝试做同样的事我得到一个错误,无法编译

abstract class ATeste : IDisposable
{
}
Run Code Online (Sandbox Code Playgroud)

'ATeste'没有实现接口成员'System.IDisposable.Dispose()'

我正在使用VS 2010和Framework 4.0.

检查ClientBase声明:

    // Summary:
//     Provides the base implementation used to create Windows Communication Foundation
//     (WCF) client objects that can call services.
//
// Type parameters:
//   TChannel:
//     The channel to be used to connect to the service.
public abstract class ClientBase<TChannel> : ICommunicationObject, IDisposable where TChannel : class
{
    // Summary:
    //     Initializes a new instance of the System.ServiceModel.ClientBase<TChannel>
    //     class using the default target …
Run Code Online (Sandbox Code Playgroud)

.net c# wcf idisposable c#-4.0

9
推荐指数
2
解决办法
6799
查看次数

标签 统计

.net ×1

c# ×1

c#-4.0 ×1

idisposable ×1

wcf ×1