.NET Core style Configuration and Hosting libraries for Xamarin

Melih Ercan
2 min readMar 23, 2021

--

Configuration

.NET Core have a built-in support to get configuration values from a JSON file appsettings.json. Multiple environments are easily supported with additional nested files: appsettings.Development.json, appsettings.Production.json, etc. Environment file overrides the key value if same key exists in the base file.

Xamarin do not have such support out of the box. Configuration library provides similar support to Xamarin Forms and Native applications. It has been implemented by using an embedded resource configuration provider.

Source code and more detailed description can be found in GitHub repo and the NuGet package is here.

Hosting

NET Core also have a build-in support for Hosting. A host enables developers to easily setup features such as configuration, dependency injection, logging etc.

Similar to Configuration, the Hosting library provides hosting functionality to Xamarin Forms and Native applications. The library supports the following features:

  • Configuration
  • Dependency Injection
  • Logging
  • Environment

Source code and more detailed description can be found in GitHub repo and the NuGet package is here.

--

--

No responses yet