ConfigLite is a .NET Configuration Loader
Features:
- Loads configurations from a
INI
file - Loads configurations from environment variables
- Allows configuration file to be defined using an environment variable
- Configurations from environment variables take precedence
Install-Package ConfigLite
ConfigStore store = ConfigStore.CreateFromFile("config.ini");
This sample creates a store from a the file
config.ini
. More info from documentation.
Sample INI
file:
HOST=10.10.10.250
PORT=5544
LOG_FILE=app.log
string host = store.Get<string>("HOST");
int port = store.Get<int>("PORT");
Configurations may be overridden by environment variables. More information from documentation
if (store.Contains("LOG_FILE"))
{
EnableLogFile();
}
Fork this project abelsilva/ConfigLite and submit pull requests.