0

I am hosting my WCF Services in a Managed Application.
I use ServiceHost class for this.

Regarding the class I am hosting inside the ServiceHost, should implement IDispoable ? When it will be called if i implemented :IDisposable ?
When i call servicehost.Close() ?

ilansch
  • 4,784
  • 7
  • 47
  • 96

1 Answers1

0

The main reason to implement IDisposable is if your class wraps an unmanaged resource.

Whether this is inside ServiceHost has no bearing.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • when does dispose for this class is called ? when no other class holds a reference for it ? (since i never dispose it directly), so the only time this class be disposed is when its ServiceHost wrapper is disposed ? – ilansch Aug 08 '13 at 15:22