Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing file beneath other in Visual Studio with .NET Core project

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.

VS

What kind of magic does this to the .json files?

like image 648
Allrameest Avatar asked Nov 01 '17 14:11

Allrameest


People also ask

How do I nest files in Visual Studio?

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.

How do I link a file to a project in Visual Studio?

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”.

How can I see the code-behind ASPX?

Right-click the . aspx page, and then click View Code. The code-behind file opens in the editor.


1 Answers

As this answer suggest, use XML similar to:

<None Update="appsettings.*.yml">
  <DependentUpon>appsettings.yml</DependentUpon>
</None>

enter image description here

Note that you need the Update, not Include attribute

like image 55
VMAtm Avatar answered Oct 08 '22 01:10

VMAtm