16 Publishing and deploying your application

 

This chapter covers

  • Publishing an ASP.NET Core application
  • Hosting an ASP.NET Core application in IIS
  • Customizing the URLs for an ASP.NET Core app
  • Optimizing client-side assets with bundling and minification

We’ve covered a vast amount of ground so far in this book. We’ve gone over the basic mechanics of building an ASP.NET Core application, such as configuring dependency injection, loading app settings, and building a middleware pipeline. We’ve looked at the UI side, using Razor templates and layouts to build an HTML response. And we’ve looked at higher-level abstractions, such as EF Core and ASP.NET Core Identity, that let you interact with a database and add users to your application. In this chapter we’re taking a slightly different route. Instead of looking at ways to build bigger and better applications, we’ll focus on what it means to deploy your application so that users can access it.

We’ll start by looking again at the ASP.NET Core hosting model in section 16.1 and examining why you might want to host your application behind a reverse proxy instead of exposing your app directly to the internet. I’ll show you the difference between running an ASP.NET Core app in development using dotnet run and publishing the app for use on a remote server. Finally, I’ll describe some of the options available to you when deciding how and where to deploy your app.

16.1 Understanding the ASP.NET Core hosting model

16.1.1 Running vs. publishing an ASP.NET Core app

16.1.2 Choosing a deployment method for your application

16.2 Publishing your app to IIS

16.2.1 Configuring IIS for ASP.NET Core

16.2.2 Preparing and publishing your application to IIS

16.3 Hosting an application on Linux

16.3.1 Running an ASP.NET Core app behind a reverse proxy on Linux

16.3.2 Preparing your app for deployment to Linux

16.4 Configuring the URLs for your application

16.5 Optimizing your client-side assets using BundlerMinifier

16.5.1 Speeding up an app using bundling and minification

16.5.2 Adding BundlerMinifier to your application

16.5.3 Using minified files in production with the Environment Tag Helper

16.5.4 Serving common files from a CDN

Summary