A basic key/value Configuration Builder for the .Net Framework that draws from environment variables.
$ dotnet add package Microsoft.Configuration.ConfigurationBuilders.EnvironmentThis package offers the most basic of the config builders. It draws its values from Environment, and it does not have any additional configuration options. More comprehensive documentation exists at the MicrosoftConfigBuilders project.
The basic usage of this builder is given below. Parameters inside []s are optional. Parameters grouped in ()s are mutually exclusive. Parameters beginning with @ allow appSettings substitution. The first line of parameters are common to all builders and optional. Their meaning, usage, and defaults are documented here. They are grouped on one line for brevity. When a builder uses a different default value than the project default, the differing value is also listed. Builder-specific settings are listed on each line thereafter followed by a brief explanation.
<add name="Environment"
[@mode|@enabled="optional"|@charMap=":=__"|@prefix|@stripPrefix|tokenPattern|@escapeExpandedValues]
type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment" />
A more complete list of updates lives here. These are the ones most relevant to this builder:
Expand mode is gone. It has been replaced by Token mode.optional attribute is obsolete => enabled attribute which provides more versatility. (The attribute is still parsed and recognized in the absence of the newer attribute, but builders should migrate to use the new attribute name when possible. Installation scripts should try to handle this automatically.)optionalcharMap attribute to allow this character mapping to work with all KeyValueConfigBuilders and to be handled in an easily configurable manner.A more complete list of updates lives here. These are the ones most relevant to this builder:
appSettings. Read more about it here.optional tag that some of the builders in this project employed in V1 has been moved into the base class and is now available on all key/value config builders.