manually added id must match the one in the project file

pull/31893/head
Tom Dykstra 2024-02-23 16:34:19 -08:00
parent e06e2c8a88
commit e35aed0e40
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,7 @@ description: Learn how to store and retrieve sensitive information during the de
ms.author: riande
monikerRange: '>= aspnetcore-3.0'
ms.custom: mvc
ms.date: 02/22/2024
ms.date: 02/23/2024
uid: security/app-secrets
---
# Safe storage of app secrets in development in ASP.NET Core
@ -90,6 +90,8 @@ If the generation of assembly info attributes is disabled, manually add the <xr
[assembly: UserSecretsId("your_user_secrets_id")]
```
When manually adding the `UserSecretsId` attribute to `AssemblyInfo.cs`, the `UserSecretsId` value must match the value in the project file.
## Set a secret
Define an app secret consisting of a key and its value. The secret is associated with the project's `UserSecretsId` value. For example, run the following command from the directory in which the project file exists: