How do I stop a WCF web service?

I've stopped the website in IIS, made a change in Web.config, but the damn thing keeps writting my log events into my database! The only solution I've found is to restart IIS completely. This isn't a very good solution because then all my websites have to stop/restart.


I've done some digging around and found the servicefactory that the service uses. Here's the whole class.

/// <summary>
/// Derive from this class to create a duplex Service Factory to use in an .svc file
/// </summary>
/// <typeparam name="T">The Duplex Service type (typically derived from DuplexService)</typeparam>
public abstract class DuplexServiceFactory<T> : ServiceHostFactoryBase where T : IUniversalDuplexContract, new()
    T serviceInstance = new T();

    /// <summary>
    /// This method is called by WCF when it needs to construct the service.
    /// Typically this should not be overridden further.
    /// </summary>
    public override ServiceHostBase CreateServiceHost( string constructorString, Uri[] baseAddresses )
        ServiceHost service = new ServiceHost( serviceInstance, baseAddresses[ 0 ] );
        CustomBinding binding = new CustomBinding(
                                new PollingDuplexBindingElement(),
                                new BinaryMessageEncodingBindingElement(),
                                new HttpTransportBindingElement()

        service.Description.Behaviors.Add( new ServiceMetadataBehavior() );
        service.AddServiceEndpoint( typeof( IUniversalDuplexContract ), binding, "" );
        service.AddServiceEndpoint( typeof( IMetadataExchange ), MetadataExchangeBindings.CreateMexHttpBinding(), "mex" );
        return service;

This just returns a new service instance, but as to who is making the call, I don't know. My SVC file points to this class as the factory. The trail ends here, but I don't understand where the whole process itself is running under.


What process is your WCF web service running in? Are you sure it's IIS? Could it be something else? WCF can run in many different processes. You'll have to figure out what process it's in (it may not necessarily be IIS) and kill that process to get it to stop.

Need Your Help

Laravel 5.1, Dingo - Nested Transformers

laravel dingo-api

Is there an elegant way to nest transformers for relationship use? I'm looking to build a REST interface that allows for collections to conditionally include relationship models. So far I've been

How do Session variables set before a redirect in OAuth flow remain to compare after the user returns?

php session facebook-graph-api oauth

I'm in the process of setting up various authentication methods on a project I'm working on, and the common OAuth 2.0 framework that Google and Facebook use seems pretty awesome. Reading the example