How to get rid of System.ServiceModel.ClientBase <TChannel>?
I use a class that extends ClientBase <>:
interface IService {}
class MyServiceClient : ClientBase<IService> {}
The problem I am facing is that FxCop complains that a class with MyServiceClient as a member variable should also implement IDisposable and recycle MyServiceClient.
ClientBase has an explicit implementation of Dispose (), which means that the simple MyServiceClient.Dispose () does not compile. I must explicitly point to IDisposable. Why is this? Is this a signal that I should not use Dispose ()? Should I use Close () instead?
+3
2 answers
, . :
using (var someClient = new SomeClient(_netTcpBinding,_endpointAddress))
{
return someClient.SomeMethod();
}
cmd netstat -a -n -p TCP,

, http://sahilmalik.blogspot.ru/2005/11/sockets-and-timewait.html , http://marcgravell.blogspot.ru/2008/11/dontdontuse-using.html
0