-
Notifications
You must be signed in to change notification settings - Fork 40
Setting up a self hosted web application
This chapter explains how to setup an application in case you want to host the web services yourself in you application instead of deploying the application to IIS.
The first step is to add a reference to Ninject.Web.Common.Selfhost either by adding the reference manually or install the corresponding NuGet Package.
The second step is to create and start a NinjectSelfHostBootstrapper instance in cour composition root of your application like shown in the following example:
private void StartNinjectSelfHost() { var someServiceConfiguration = ... // Configurations are specific to the type of var anotherServiceConfiguration = ... // web service. Please read the documentation for // the technology you are using. this.selfHost = new NinjectSelfHostBootstrapper( CreateKernel, someServiceConfiguration, anotherServiceConfiguration); this.selfHost.Start(); }
///