Is it necessary to Dispose() when using a custom ServiceHostFactory?
In my WCF .svc file I have defined a custom Factory as:
<%@ ServiceHost Factory="Service.ServiceHostFactory" %>
It appears that a Dispose() is not being called since the overridden CreateServiceHost() method is not being called at each execution of the application calling the service. (Also, among other things, logging is not being performed after each call and the trace.xml file I generated says that it is in use by another process).
I do have the service decorated with
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
so I expect something else is going on that I'm not aware of. In the client application where the instance to the service is created I am Dispose()'ing of the reference via a finally block but is it necessary to perform a similar operation in the Factory on the server side?
Finally
service.Dispose()
End Try
Thanks