Skip to content

Setup selfhosted WCF services

remogloor edited this page Feb 18, 2013 · 6 revisions

Selfhosting of WCF services is based on Ninject.Web.Common.SelfHosting. To use it you have to follow the documentation of this package.

Once this is done you can define WCF service configurations using the static methods on NinjectWcfConfiguration. The simplest variant is to specify what factory shall by used for a service type

```text
    NinjectWcfConfiguration.Create();
    NinjectWcfConfiguration.Create();
```

Configure the service host using code

There are other overloads that allow to configure the service host by specifying an action that is executed when the service host is created.

```text
    NinjectWcfConfiguration.Create(
        servicehost => servicehost.AddServiceEndpoint( ... ));
```

Configure the service host using App.config

The WCF services can be configured using the usual way in the section of the App.config

Clone this wiki locally