.NET Core Configuration is Simple

Let’s assume we want to create a simple Web API project. We need to add a connection string section to the **appsetting.json** file which is a default setup for the.NET Core Web API application. By default, appsettings.json and appsettings.Development.json files are created for the new project. It means that you could follow the pattern to create a configuration file for different environments and switch between them. Sometimes it happens that you need to add a configuration file with the custom name or path. It can be easily done in Program.cs file. You just need to call ConifugureAppConfiguration() method for the instance of IHostBuilder.

image
Igor Lopushko Hacker Noon profile picture

Igor Lopushko

Programmer, Architect, Teacher

Tags



.NET Core Configuration is Simple
Source: Super Trending News PH

Post a Comment

0 Comments