14 Configuring and publishing your application
This chapter covers
- Understanding and managing environments
- Managing application configuration with appSettings
- Improving performance with Caching
- Publishing your application
We got there! Well, almost. We’ve written our application and made sure it is secured against external threats. It’s virtually ready to go live, but there are one or two things we need to attend to first and this final chapter will wrap those up before walking through the publishing process.
The source of most issues that arise after an application has been deployed to a production web server is the difference between the development environment and the hosting environment. Various configurations such as database connection strings or mail server settings will often differ between the two environments. We will explore how ASP.NET Core helps you to manage the differences between these environments seamlessly using the environments concept that we have seen referred to a few times throughout this book. In addition, we will take a much closer look at the primary means for storing application configuration data - the appSettings.json file - and learn several ways in which we can read its contents at runtime.