-
Book Overview & Buying
-
Table Of Contents
Clean Architecture with .NET
By :
While environment-specific configuration files help separate settings by deployment target, they are still committed to source control and should not contain sensitive values such as API keys, connection strings, or credentials. For local development, .NET provides User Secrets as a lightweight mechanism for storing sensitive configuration values outside of the project and repository.
User Secrets are stored on the developer's machine and scoped to a specific project. They integrate directly with the existing configuration system, meaning values stored as User Secrets behave just like values from appsettings.json or environment variables—they can be bound to options classes and injected through DI in the same way.
It's important to understand the scope and limitations of User Secrets. They are not encrypted, nor are they intended for production use. Their purpose is convenience and safety during local development, helping prevent...