Monday, July 18, 2022

Loading appsettings.json in a different project type

So I found myself in a situation where I needed to access data stored in a configuration file for a DOTNET Core project, so I dug around and found that a few steps are required which are listed below: 

  • Add references to the following Nuget packages 

  • Add your empty appsettings.json file to the root of your project 
  • Add the below code entry:


Once complete you should be able to access the appsettings as you usually do in any dotnet core web project.