Installing the ASP.NET Core module for IIS

We might think that IIS is the ideal platform for hosting ASP.NET Core applications, as it always has been since the first release of ASP.NET. As a matter of fact, it's not that ASP.NET Core web applications run via the highly optimized Kestrel server. Whenever we choose to host one of them with IIS, we basically need it to act as a reverse proxy for the underlying Kestrel server.

This is confirmed by the official documentation at the following URL: https://docs.microsoft.com/en-us/aspnet/core/hosting/iis-modules , where we can read the following:

ASP.NET Core applications are hosted by IIS in a reverse-proxy configuration. Some of the native IIS modules and all of the IIS managed modules are not available to process requests for ASP.NET Core apps. In many cases, ASP.NET Core offers an alternative to the features of IIS native and managed modules.

The good news is that we don't need to configure anything by ourselves within our web app project, because the .NET Core IIS module will do everything by itself, assuming that it is installed on the Web Server! Since ASP.NET Core is a rather new technology, this might as well not be the case, so we'll most likely need to download and install it.

At the time of writing, we need to obtain the .NET Core Windows Server Hosting bundle, which conveniently includes all the required packages to host a .NET Core application on a IIS powered server machine: the .NET Core runtime, the .NET Core Library and the ASP.NET Core module; upon installation, it will create the aforementioned reverse proxy between IIS and the Kestrel server in a transparent way, thus allowing the former to serve our app.

The bundle can be downloaded from https://aka.ms/dotnetcore-2-windowshosting

IMPORTANT: the bundle comes with its own version number, wich needs to match the .NET Core version used to build the project. In our scenario it will be 2.0.3, unless we changed it with a newer one - at our own risk - back in chapter 1, Getting Ready.

In the unlikely case that the web server machine doesn't have an internet connection available, we will also need to obtain and install the Microsoft Visual C++ 2015 Redistributable before installing the .NET Core Windows Server Hosting bundle, which we can get from https://www.microsoft.com/download/details.aspx?id=53840.

For further references regarding ASP.NET Core IIS publishing settings, it's strongly advised to check out the official guide at https://docs.asp.net/en/latest/publishing/iis.html#iis-configuration. A (mostly) complete list of all the available .NET Core related packages (SDK, IIS module, and more) is also available at https://www.microsoft.com/net/download.
..................Content has been hidden....................

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