UserSecretsConfigurationExtensions.AddUserSecrets UserSecretsConfigurationExtensions.AddUserSecrets UserSecretsConfigurationExtensions.AddUserSecrets Method

Definition

Overloads

AddUserSecrets(IConfigurationBuilder, Assembly) 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.

AddUserSecrets(IConfigurationBuilder, String) AddUserSecrets(IConfigurationBuilder, String) 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) 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.

AddUserSecrets<T>(IConfigurationBuilder) AddUserSecrets<T>(IConfigurationBuilder) 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.

AddUserSecrets<T>(IConfigurationBuilder, Boolean) AddUserSecrets<T>(IConfigurationBuilder, Boolean) 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.

AddUserSecrets(IConfigurationBuilder, Assembly) 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 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
Parameters
configuration
IConfigurationBuilder IConfigurationBuilder IConfigurationBuilder

The configuration builder.

assembly
Assembly Assembly Assembly

The assembly with the UserSecretsIdAttribute.

Returns
Exceptions

AddUserSecrets(IConfigurationBuilder, String) AddUserSecrets(IConfigurationBuilder, String) 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 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 IConfigurationBuilder IConfigurationBuilder

The configuration builder.

userSecretsId
String String String

The user secrets ID.

Returns

AddUserSecrets(IConfigurationBuilder, Assembly, Boolean) 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 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
Parameters
configuration
IConfigurationBuilder IConfigurationBuilder IConfigurationBuilder

The configuration builder.

assembly
Assembly Assembly Assembly

The assembly with the UserSecretsIdAttribute.

optional
Boolean Boolean Boolean

Whether loading secrets is optional. When false, this method may throw.

Returns
Exceptions

AddUserSecrets<T>(IConfigurationBuilder) AddUserSecrets<T>(IConfigurationBuilder) 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 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 IConfigurationBuilder IConfigurationBuilder

The configuration builder.

Returns
Exceptions

AddUserSecrets<T>(IConfigurationBuilder, Boolean) AddUserSecrets<T>(IConfigurationBuilder, Boolean) 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 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 IConfigurationBuilder IConfigurationBuilder

The configuration builder.

optional
Boolean Boolean Boolean

Whether loading secrets is optional. When false, this method may throw.

Returns
Exceptions

Thrown when optional is false and the assembly containing T does not have a valid UserSecretsIdAttribute.

Applies to