There is an app.config file template you can use that is provided by Visual Studio for Mac.
From the File menu select New File. Then select Misc - Application Config File in the new file dialog.
Then add your appSettings to that file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Application Name" value="MyApplication" />
</appSettings>
</configuration>
To avoid the warning about using System.Configuration.AppSettings
, since this is deprecated, you will need to add a reference to System.Configuration by right clicking the References in the Solution window, selecting Edit References. Then search for System.Configuration in that dialog. Tick the reference and click OK. Then you can use System.Configuration.ConfigurationManager.AppSettings
.
string setting = System.Configuration.ConfigurationManager.AppSettings["Application Name"];