Warning CA2000 : Microsoft.Reliability : In method 'ProtocolHelper<TClass, TClassType>.ProcessApplicanceData(object)', call System.IDisposable.Dispose on object '<>g__initLocal5' before all references to it are out of scope.
下面是代码,上面是我得到的警告。
public WCFServiceClient(Callback callback, WDaaSAuthMode authMode)
: base()
{
AuthMode = authMode;
CallbackInstance = callback;
}
public T Client
{
get
{
if (_client == null)
{
channelFactory = new DuplexChannelFactory<T>(CallbackInstance, EndPoint);
return CreateClient();
}
return _client;
}
}
public Callback CallbackInstance { get; set; }
}
在很多情况下,我都收到了上述警告。我尝试了“使用”和“尝试,最后”,但没有解决我的问题。谁能帮我解决这个问题。提前致谢。