Microsoft.Configuration.ConfigurationBuilders.UserSecrets
3.0.0
Prefix Reserved
dotnet add package Microsoft.Configuration.ConfigurationBuilders.UserSecrets --version 3.0.0
NuGet\Install-Package Microsoft.Configuration.ConfigurationBuilders.UserSecrets -Version 3.0.0
<PackageReference Include="Microsoft.Configuration.ConfigurationBuilders.UserSecrets" Version="3.0.0" />
paket add Microsoft.Configuration.ConfigurationBuilders.UserSecrets --version 3.0.0
#r "nuget: Microsoft.Configuration.ConfigurationBuilders.UserSecrets, 3.0.0"
// Install Microsoft.Configuration.ConfigurationBuilders.UserSecrets as a Cake Addin #addin nuget:?package=Microsoft.Configuration.ConfigurationBuilders.UserSecrets&version=3.0.0 // Install Microsoft.Configuration.ConfigurationBuilders.UserSecrets as a Cake Tool #tool nuget:?package=Microsoft.Configuration.ConfigurationBuilders.UserSecrets&version=3.0.0
UserSecrets ConfigBuilder
This package provides a config builder that draws its values from an Xml
file - usually stored outside of source controll - containing a list of secrets. The secrets file can be configured directly, or it can be specified by a userSecretsId
which helps to locate the file in a well-known 'UserSecrets' directory. More comprehensive documentation for using this builder 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 and use are documented at the MicrosoftConfigBuilders project. Tthey are grouped on one line for brevity. Builder-specific settings are listed on each line thereafter followed by a brief explanation at the end. When a builder uses a different default value than the MicrosoftConfigBuilders project as a whole, the differing default is also listed.
<add name="UserSecrets"
[@mode|@enabled="optional"|@charMap|@prefix|@stripPrefix|tokenPattern|@escapeExpandedValues]
(@userSecretsId="12345678-90AB-CDEF-1234-567890" | @userSecretsFile="~\secrets.file")
type="Microsoft.Configuration.ConfigurationBuilders.UserSecretsConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.UserSecrets" />
userSecretsId
- This is the preferred method for identifying an xml secrets file. It works similar to .Net Core, which uses a 'UserSecretsId' project property to store this identifier. With this attribute, theUserSecretsConfigBuilder
will look in a well-known local location (%APPDATA%\Microsoft\UserSecrets\<userSecretsId>\secrets.xml in Windows environments) for a secrets file belonging to this identifier.userSecretsFile
- An optional attribute specifying the file containing the secrets. The '~' character can be used at the start to reference the app root. One of this attribute or the 'userSecretsId' attribute is required. If both are specified, 'userSecretsFile' takes precedence.
V3 Updates:
A more complete list of updates lives here. These are the ones most relevant to this builder:
- ⚠️ Breaking Change -
Expand
mode is gone. It has been replaced byToken
mode. optional
attribute is obsolete ⇒enabled
attribute which provides more versatility. (Theoptional
attribute is still parsed and recognized in the absence of the newerenabled
attribute, but builders should migrate to use the new attribute name when possible. Installation scripts should try to handle this automatically.)
V2 Updates:
A more complete list of updates lives here. These are the ones most relevant to this builder:
- ConfigBuilder Parameters from AppSettings - This has been one of the most asked for features of these config builders. With V2, it is now possible to read initialization parameters for config builders from
appSettings
. Read more about it here. - [[Obsolete]] This has been superceded by the enabled tag. (
Base Optional Tag - The)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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net471 is compatible. net472 was computed. net48 was computed. net481 was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 464,089 | 4/12/2023 |
3.0.0-preview2 | 956 | 1/18/2023 |
3.0.0-preview1 | 13,794 | 4/1/2022 |
2.0.0 | 2,602,198 | 2/22/2020 |
2.0.0-rc | 2,370 | 1/10/2020 |
2.0.0-beta | 15,098 | 2/26/2019 |
1.0.2 | 265,832 | 7/9/2018 |
1.0.1 | 18,399 | 5/25/2018 |
1.0.0-preview3 | 1,635 | 5/4/2018 |
1.0.0-preview2 | 1,830 | 3/10/2018 |
1.0.0-preview | 1,705 | 11/17/2017 |