views:

84

answers:

1

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.

UPDATE

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.

A: 

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.

Jaxidian
Does IIS run in many processes or AppDomains?
kenny
I have a Silverlight client that connects via Duplex messaging. I assumed that web service instances are connected to the website. How could I detect what process the service is running under? Is it possible to change the process too?
Matt
@Matt: WCF services can be self-hosted. They can run in almost any kind of process. You'll have to find out if the service is hosted in IIS, or in a separate process, perhaps in a Windows Service.
John Saunders
@Kenny: IIS runs in only as many AppDomains as you have configured. However, WCF need not be running in IIS.
Jaxidian
@Matt: John is correct - you need to figure out how you are deploying the WCF service to determine what process it is running in. Go see if you can see a call to the "Open()" method of an instantiation of a "ServiceHost" somewhere in your solution. It could be a custom process that is hosting it.
Jaxidian
I've managed to find the servicefactory for the service. I've posted an update.
Matt