Do I need Dispose () to use the custom ServiceHostFactory?
In my WCF.svc file, I defined a custom Factory as: <%@ ServiceHost Factory="Service.ServiceHostFactory" %>
Dispose () does not seem to be called because the overridden CreateServiceHost () method is not called every time the application invokes the service. (Also, among other things, logging is not performed after each call, and the trace.xml file that I created says that it is being used by another process).
I have a service decorated with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] so I expect something else to happen that I donβt know about. In the client application where the service instance is created, I place the Dispose () link of the link through the finally block, but do I need to perform a similar operation in Factory on the server side?
Finally service.Dispose() End Try
thanks
source share