Reputation: 4492
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?
Upvotes: 6
Views: 2753
Reputation: 93173
Have a look at the File Nesting extension provided by Mads Kristensen, if you haven't already. According to the description, this allows you to both manually nest files and set up your own rules for automatic nesting.
You can just search for this under the Visual Studio Extensions and Updates component.
EDIT: According to the known issues, this is not supported in all project types:
Due to missing or limited support for file nesting in certain project types, this extension will have no effect or be disabled. The project types are:
Node.js projects (NTVS)
ASP.NET Core (has built in rules for nesting)
Apache Cordova
Shared projects
Upvotes: 2
Reputation: 28355
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
Upvotes: 12