In my ASP.NET Core project the .json
settings files are group under the main one. But if I use .yml
instead, it won't do that.
In the old csproj there was a lot of XML for these kinds of things. But can't find any references to the settings files in it now.
What kind of magic does this to the .json
files?
The precedence for merging file nesting settings is: Visual Studio > Solution > Project. You can tell Visual Studio to ignore solution-specific and project-specific settings, even if the files exist on disk, by enabling the option Ignore solution and project settings under Tools > Options > ASP.NET Core > File Nesting.
1) Right-click “utilities” folder on Visual Studio and select “Add -> Existing item”. 2) Select the file to add, clicking on it ONCE (do not double-click). 3) Click in the arrow next to the “Add” button and select “Add As Link”.
Right-click the . aspx page, and then click View Code. The code-behind file opens in the editor.
As this answer suggest, use XML similar to:
<None Update="appsettings.*.yml">
<DependentUpon>appsettings.yml</DependentUpon>
</None>
Note that you need the Update
, not Include
attribute
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With