Partager via


IVsProjectSecrets.GetSecretAsync(String, CancellationToken) Method

Definition

Gets the secret with the given name.

public System.Threading.Tasks.Task<string> GetSecretAsync (string name, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSecretAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function GetSecretAsync (name As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

Parameters

name
String

The name of the secret whose value should be retrieved. Must not be null or empty.

cancellationToken
CancellationToken

A token that may cancel this operation.

Returns

The value of the secret.

Exceptions

Thrown if name is null.

Thrown if name is empty.

Thrown if no secret with the specified name could be found.

Thrown when the user does not have permission for this operation.

Thrown when the operation could not be completed due to some network or I/O failure.

Applies to