'Nesting .NET Core appsettings.json appsettings.development.json and appsettings.release.json

I have two asp.net core console apps.

First one has appsettings json files as shown below.

appsettings json files nested

As you can see they are nicely nested.

The second core project is also console project. I have added appsettings json files but they are nested.

What am I missing

appsettings json files not nested



Solution 1:[1]

You can try to do like this:

<ItemGroup>
        <None Update="appsettings.Development.json">
            <DependentUpon>appsettings.json</DependentUpon>
        </None>
    </ItemGroup>
    <ItemGroup>
        <None Update="appsettings.Release.json">
            <DependentUpon>appsettings.json</DependentUpon>
        </None>
    </ItemGroup>

result:

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yiyi You