Posts

Showing posts from December, 2019

Demystifying User Secrets in .Net Core

Image
User Secrets are a convenient way to store local configuration values in your .Net Core applications. When you create a new .Net Core application, a usersecrets.json file will be automatically created for you to store your local config values. You can manage the values inside your solution by opening up the json file through the web project context menu. Inside this file, you will see an empty object by default. You can copy over your entire appsettings.json or specific sections and modify them as you see fit for local use. When you run the solution, the config values in usersecrets.json will merge with appsettings.json and overwrite any values that match. If you want to see where the file is located, right-click the open tab in VS and click "Open Containing Folder". This will take you to your local AppData > Roaming directory. If you back out of this directory, you will see folders for all of your apps and you will notice that MS uses g