There's two ways of creating the file and writing inside of it:
Using Visual Studio
1. Right-click on the Solution Explorer
2. Click on the option Manage User Secrets
Using .NET CLI
First you use the following command to create the file where it will be stored
dotnet user-secrets init
And adding another command to create a secret value inside the recent created file:
dotnet user-secrets set "MySecret" "12345"
After that, the file will look someting like this:
{
"MySecret": "12345"
}
In the end your secrets.json file need to follow the structure below, where you need to edit all the values accordingly to you necessity
{
"AuthenticationData": {
"Email": "string",
"Password": "string",
"Hostname": "string",
"Port": "int",
"UseSSL": "bool"
},
"EmailReceived": {
"Address": "string",
"Attachment1": "string",
"Attachment2": "string"
},
"Others": {
"TargetPath": "string"
}
}