If I add an appsetting.{environment}.json
to the project, normal it will automatically show up under the appsetting.json
.
For example I added one for environment "Test".
But if I add one for environment "New.New" it does not show up under appsetting.json
.
Is there any way to get appsettings.New.New.json
showing under appsetting.json
You can adjust the file nesting rules; see the documentation.
Because of this double additional .New.New
extension in the middle, I only get success by setting up a custom FileToFile
rule, which requires the entire file name .
Create a .filenesting.json
file in your project folder or in the solution folder and add below rule that defines that appsettings.New.New.json
should be nested under appsettings.json
.
{
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"root": false,
"dependentFileProviders": {
"add": {
"fileToFile": {
"add": {
"appsettings.New.New.json": [
"appsettings.json"
]
}
}
}
}
}
Visual Studio will show the expected nesting.