Deploying to IIS

We need to ensure that the HttpPlatformHandler module that acts as a reverse proxy is installed when you deploy to an IIS server. When the request comes in, IIS forwards it to another process, which is typically a command-line application. IIS will start and stop the process when needed and take care of concurrency.

In the IIS management application, our application is considered as another website, and can be configured in IIS. We need to inform IIS to execute the DNX when our application gets a request. We can achieve it using the web.config present in the project's folder. IIS still uses web.config for HttpPlatformHandler:

Fig 11: Configuring HttpPlatformHandler in the web.config file

The HttpPlatformHandler extension is registered with IIS and is instructed to execute the batch file starting the DNX process when it gets a request. So, let's configure the app in IIS.

To configure our application, start the IIS manager. Right-click on the root server node and choose Add Website, type the application name, and an application pool will automatically be generated for our application:

Fig 12: Adding a website to IIS

Set the path to the wwwroot folder of the published application in the physical path textbox and click on OK. As the CLR is running in the exclusive process, we need to set No Managed Code under .NET CLR version on the application pool:

Fig 13: Setting No Managed Code in .NET CLR for App Pool

We are doing this because we don't need IIS to host the CLR for our application. Clicking on OK and browsing to the localhost port 8080 will launch our application. In this way, we can use the features of IIS to power DNX application similar to any other web application hosted in IIS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset