there is a Xamarin Centric AppSetting reader: https://www.nuget.org/packages/PCLAppConfig is quite useful for continuous delivery (therefore, a deployment server such as an octopus allows you to modify the configuration file for each environment with values ββstored on the cd server).
there is a built-in Xamarin reader AppSetting at https://www.nuget.org/packages/PCLAppConfig this is very useful for continuous delivery;
use below:
1) Add the nuget package link to your pcl projects and platforms.
2) Add the app.config file to your PCL project, and then as a linked file in all your platform projects. For android, make sure that the build action is set to "AndroidAsset", for UWP, set the build action to "Content". Add the keys / settings: <add key="config.text" value="hello from app.settings!" /> <add key="config.text" value="hello from app.settings!" />
3) Initialize ConfigurationManager.AppSettings in each of your platform projects right after the Xamarin.Forms.Forms.Init instruction, which is located on AppDelegate in iOS, MainActivity.cs in Android, application in UWP / Windows 8.1 / WP 8.1:
ConfigurationManager.Initialise(PCLAppConfig.FileSystemStream.PortableStream.Current);
3) Read your settings: ConfigurationManager.AppSettings["config.text"];
Ben ishiyama-levy
source share