Answers for "include appsettings json in build console app c#"

C#
2

use appsettings.json in console app

All that’s required is to add the following NuGet packages and an appsettings.json file.

Microsoft.Extensions.Configuration
Microsoft.Extensions.Configuration.FileExtensions
Microsoft.Extensions.Configuration.Json

The appsettings.json files “Copy to Output Directory” property should also be set to “Copy if newer” so that the application is able to access it when published.
Posted by: Guest on March-10-2020
-1

appsettings in console application c#

{
    "SomeKey": "This is from Config!"
}
Posted by: Guest on May-22-2020

C# Answers by Framework

Browse Popular Code Answers by Language