liveBook · Manning

Chapter 27: Publishing and deploying your application

What you will learn in chapter 27 of ASP.NET Core in Action, 3e

This chapter introduction frames deployment as making an ASP.NET Core application accessible to users and previews hosting, IIS, Linux, and URL configuration.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduction frames deployment as making an ASP.NET Core application accessible to users and previews hosting, IIS, Linux, and URL configuration.

Key terms: deployment, hosting, remote server, ASP.NET Core hosting model, reverse proxy, dotnet run, publishing, IIS, ASPNETCORE_URLS, legacy ASP.NET

27.1 Understanding the ASP.NET Core hosting model

This section explains that ASP.NET Core apps are console processes hosting Kestrel and can be deployed directly or behind a reverse proxy, with resulting trade-offs.

Key terms: hosting model, console application, static void Main, top-level statements, Kestrel, web server, reverse proxy, IIS, NGINX, Apache

27.1.1 Running vs. publishing an ASP.NET Core app

This section distinguishes development-time running from production publishing, explains how to run published output, and compares framework-dependent with self-contained deployments.

Key terms: .NET CLI, dotnet new, dotnet restore, dotnet build, dotnet run, Visual Studio, bin folder, artifacts, dotnet publish, publish folder

27.1.2 Choosing a deployment method for your application

This section compares manual, automated, and Visual Studio-based deployment approaches and sets the chapter’s focus on deploying an ASP.NET Core app alongside legacy apps on IIS.

Key terms: production, server, deploy, continuous integration, continuous delivery, continuous deployment, CI/CD, version control, Git, Visual Studio

27.2 Publishing your app to IIS

This section introduces the basic IIS setup and application preparation needed to deploy a published ASP.NET Core app on Windows behind IIS as a reverse proxy.

Key terms: IIS, reverse proxy, ASP.NET Core, production, application pool, website, published app, hosting folder, Windows, development machine

27.2.1 Configuring IIS for ASP.NET Core

This section prepares IIS to host an ASP.NET Core application by installing the Windows Hosting Bundle, configuring an unmanaged application pool and website, and granting the pool access to the publish folder.

Key terms: ASP.NET Core Windows Hosting Bundle, .NET Runtime, ASP.NET Core Runtime, IIS AspNetCore Module, reverse proxy, self-contained deployment, application pool, No Managed Code, .NET CLR version, native ASP.NET Core Module

27.2.2 Preparing and publishing your application to IIS

This section explains how to prepare an ASP.NET Core application for IIS hosting and publish its files for deployment behind IIS as a reverse proxy.

Key terms: IIS integration, WebApplicationBuilder, UseIIS(), UseIISIntegration(), custom application builder, in-process hosting model, out-of-process hosting model, IIS process, forwarded headers, Windows authentication

27.3 Hosting an application in Linux

This section introduces why ASP.NET Core can be hosted on Linux and frames the following material as a high-level deployment overview rather than detailed Linux configuration guidance.

Key terms: cross-platform, Linux, Raspberry Pi, Docker containers, configuration, resources

27.3.1 Running an ASP.NET Core app behind a reverse proxy in Linux

This section explains how to deploy an ASP.NET Core application on Linux by separating publishing, reverse-proxying, and process-management responsibilities.

Key terms: dotnet publish, RDD, SCD, runtime identifier, .NET 7 Runtime, reverse proxy, process manager, IIS, systemd, NGINX

27.3.2 Preparing your app for deployment to Linux

This section explains how to make an ASP.NET Core app behave correctly behind a Linux reverse proxy and avoid common Windows-to-Linux deployment pitfalls.

Key terms: reverse proxy, SSL/TLS offloading, X-Forwarded-For, X-Forwarded-Proto, Request.Scheme, HttpContext, ForwardedHeadersMiddleware, ASPNETCORE_FORWARDEDHEADERS_ENABLED, WebApplicationBuilder, generic host

27.4 Configuring the URLs for your application

This section explains when ASP.NET Core URL bindings must be configured and how to configure them with environment variables or command-line arguments.

Key terms: IIS, reverse proxy, ASP.NET Core Module, hostname, ASPNETCORE_URLS, localhost, http://localhost:5000, http://*:5002, environment variable, launchSettings.json

27.5 Summary

This summary recaps how ASP.NET Core apps are published, hosted behind IIS or reverse proxies, and configured to listen on URLs in production.

Where this is used later

Concepts explained in this chapter

← Chapter 26: Monitoring and troubleshooting errors with logging Chapter 28: Adding HTTPS to an application →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.