.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

Is art a good financial investment?

 The fine art industry is still booming. Every day, it seems, a new auction record for "the highest sum ever paid " is set....

Do you know about the Different Aircraft Antenna Varieties?

A myriad of antennas is frequently seen all over the fuselage of a plane. The advancement in technology has made it possible to incorporate...

5 Essential questions to ask before appointing a personal injury lawyer

Are you someone who has lately suffered from severe injuries due to the fault of someone else? If yes, you might be desperately looking...

Retired from your job? Guide to withdraw your EPF money and where to invest it

Retired from your job? Guide to withdraw your EPF money and where to invest it

Harry Styles set to land an eye-watering £40m fee for string of gigs in Las Vegas

Harry Styles is reportedly set to secure a £40million fee to perform a string of gigs in Las Vegas. The 28-year-old singer is currently...