UserSecretsConfigurationExtensions.AddUserSecrets Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddUserSecrets(IConfigurationBuilder, Assembly) |
Adds the user secrets configuration source. This searches A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets(IConfigurationBuilder, String) |
Adds the user secrets configuration source with specified user secrets ID. A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets(IConfigurationBuilder, Assembly, Boolean) |
Adds the user secrets configuration source. This searches A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets(IConfigurationBuilder, String, Boolean) |
Adds the user secrets configuration source with specified user secrets ID. A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets(IConfigurationBuilder, Assembly, Boolean, Boolean) |
Adds the user secrets configuration source. This searches A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets<T>(IConfigurationBuilder) |
Adds the user secrets configuration source. Searches the assembly that contains type A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets<T>(IConfigurationBuilder, Boolean) |
Adds the user secrets configuration source. Searches the assembly that contains type A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets<T>(IConfigurationBuilder, Boolean, Boolean) |
Adds the user secrets configuration source. Searches the assembly that contains type A user secrets ID is unique value used to store and identify a collection of secret configuration values. |
AddUserSecrets(IConfigurationBuilder, Assembly)
Adds the user secrets configuration source. This searches assembly
for an instance
of UserSecretsIdAttribute, which specifies a user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration, System::Reflection::Assembly ^ assembly);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration, System.Reflection.Assembly assembly);
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder * System.Reflection.Assembly -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddUserSecrets (configuration As IConfigurationBuilder, assembly As Assembly) As IConfigurationBuilder
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
- assembly
- Assembly
The assembly with the UserSecretsIdAttribute.
Returns
The configuration builder.
Exceptions
assembly
does not have a valid UserSecretsIdAttribute.
Applies to
AddUserSecrets(IConfigurationBuilder, String)
Adds the user secrets configuration source with specified user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration, System::String ^ userSecretsId);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration, string userSecretsId);
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder * string -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddUserSecrets (configuration As IConfigurationBuilder, userSecretsId As String) As IConfigurationBuilder
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
- userSecretsId
- String
The user secrets ID.
Returns
The configuration builder.
Applies to
AddUserSecrets(IConfigurationBuilder, Assembly, Boolean)
Adds the user secrets configuration source. This searches assembly
for an instance
of UserSecretsIdAttribute, which specifies a user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration, System::Reflection::Assembly ^ assembly, bool optional);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration, System.Reflection.Assembly assembly, bool optional);
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder * System.Reflection.Assembly * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddUserSecrets (configuration As IConfigurationBuilder, assembly As Assembly, optional As Boolean) As IConfigurationBuilder
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
- assembly
- Assembly
The assembly with the UserSecretsIdAttribute.
- optional
- Boolean
Whether loading secrets is optional. When false, this method may throw.
Returns
The configuration builder.
Exceptions
optional
is false and assembly
does not have a valid UserSecretsIdAttribute.
Applies to
AddUserSecrets(IConfigurationBuilder, String, Boolean)
Adds the user secrets configuration source with specified user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration, System::String ^ userSecretsId, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration, string userSecretsId, bool reloadOnChange);
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder * string * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddUserSecrets (configuration As IConfigurationBuilder, userSecretsId As String, reloadOnChange As Boolean) As IConfigurationBuilder
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
- userSecretsId
- String
The user secrets ID.
- reloadOnChange
- Boolean
Whether the configuration should be reloaded if the file changes.
Returns
The configuration builder.
Applies to
AddUserSecrets(IConfigurationBuilder, Assembly, Boolean, Boolean)
Adds the user secrets configuration source. This searches assembly
for an instance
of UserSecretsIdAttribute, which specifies a user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration, System::Reflection::Assembly ^ assembly, bool optional, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration, System.Reflection.Assembly assembly, bool optional, bool reloadOnChange);
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder * System.Reflection.Assembly * bool * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddUserSecrets (configuration As IConfigurationBuilder, assembly As Assembly, optional As Boolean, reloadOnChange As Boolean) As IConfigurationBuilder
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
- assembly
- Assembly
The assembly with the UserSecretsIdAttribute.
- optional
- Boolean
Whether loading secrets is optional. When false, this method may throw.
- reloadOnChange
- Boolean
Whether the configuration should be reloaded if the file changes.
Returns
The configuration builder.
Exceptions
optional
is false and assembly
does not have a valid UserSecretsIdAttribute.
Applies to
AddUserSecrets<T>(IConfigurationBuilder)
Adds the user secrets configuration source. Searches the assembly that contains type T
for an instance of UserSecretsIdAttribute, which specifies a user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
generic <typename T>
where T : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets<T> (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration) where T : class;
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder -> Microsoft.Extensions.Configuration.IConfigurationBuilder (requires 'T : null)
<Extension()>
Public Function AddUserSecrets(Of T As Class) (configuration As IConfigurationBuilder) As IConfigurationBuilder
Type Parameters
- T
The type from the assembly to search for an instance of UserSecretsIdAttribute.
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
Returns
The configuration builder.
Exceptions
The assembly containing T
does not have UserSecretsIdAttribute.
Applies to
AddUserSecrets<T>(IConfigurationBuilder, Boolean)
Adds the user secrets configuration source. Searches the assembly that contains type T
for an instance of UserSecretsIdAttribute, which specifies a user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
generic <typename T>
where T : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration, bool optional);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets<T> (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration, bool optional) where T : class;
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder (requires 'T : null)
<Extension()>
Public Function AddUserSecrets(Of T As Class) (configuration As IConfigurationBuilder, optional As Boolean) As IConfigurationBuilder
Type Parameters
- T
The type from the assembly to search for an instance of UserSecretsIdAttribute.
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
- optional
- Boolean
Whether loading secrets is optional. When false, this method may throw.
Returns
The configuration builder.
Exceptions
optional
is false and the assembly containing T
does not have a valid UserSecretsIdAttribute.
Applies to
AddUserSecrets<T>(IConfigurationBuilder, Boolean, Boolean)
Adds the user secrets configuration source. Searches the assembly that contains type T
for an instance of UserSecretsIdAttribute, which specifies a user secrets ID.
A user secrets ID is unique value used to store and identify a collection of secret configuration values.
public:
generic <typename T>
where T : class[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddUserSecrets(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configuration, bool optional, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddUserSecrets<T> (this Microsoft.Extensions.Configuration.IConfigurationBuilder configuration, bool optional, bool reloadOnChange) where T : class;
static member AddUserSecrets : Microsoft.Extensions.Configuration.IConfigurationBuilder * bool * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder (requires 'T : null)
<Extension()>
Public Function AddUserSecrets(Of T As Class) (configuration As IConfigurationBuilder, optional As Boolean, reloadOnChange As Boolean) As IConfigurationBuilder
Type Parameters
- T
The type from the assembly to search for an instance of UserSecretsIdAttribute.
Parameters
- configuration
- IConfigurationBuilder
The configuration builder.
- optional
- Boolean
Whether loading secrets is optional. When false, this method may throw.
- reloadOnChange
- Boolean
Whether the configuration should be reloaded if the file changes.
Returns
The configuration builder.
Exceptions
optional
is false
and the assembly containing T
does not have a valid UserSecretsIdAttribute.
Applies to
.NET