App.config .NET Core console application on Linux

0

In Windows for a console application I use the App.config , section appSettings to store some configuration parameter, see the example: <Configuration> <AppSettings> <Add key="param1" value="value1 "/> <Add key="param2" value="value2 "/> </ AppSettings> </Configuration>

Using .Net Core for a console application on Linux, where I save the configuration, is there something similar to App.config?

    
asked by Edvaldo Silva 19.08.2017 в 17:10
source

1 answer

1

If it exists, you can use the name you want for the configuration file but it is usually something like appsettings.json, the technique to do it is called "strongly typed configuration classes" which implies that you create your class of configuration like any other class and during the beginning of the application you link this class against a json file, which will be created and maintained by .Net core.

For more information, check here:

link

I'm from my cell phone and it would be a little complicated to put the required code.

    
answered by 19.08.2017 / 17:38
source