.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

Igor Lopushko Hacker Noon profile picture

Tags



Source link

Latest

The Best DIY Guide On How To Clean Bamboo Carpets

bamboo rugs are one of the most underrated components when it comes to decorating your home or the outside patio.For centuries, people have been...

Centre may have recalled West Bengal chief secy amid row with state, but Mamata Banerjee may refuse to play ball: Experts

Former top bureaucrats and legal experts believe that the Central government's order recalling West Bengal Chief Secretary Alapan Bandyopadhyay to Delhi, on the...

How to Deploy a React App to GitHub Pages

This article outlines how to smoothly deploy a React App through Github while avoiding common problems that such a process is likely to...

Zerodha-backed Wint Wealth launches new debt investment product to offer 9.5% pre-tax XIRR in 18 months

Representative imageZerodha-backed alternate debt asset platform Wint Wealth on Monday (May 31, 2021) launched Wint Bricks through which business loans backed by property...