I am trying to nest files by pathSegment
in Visual Studio 2017 for ASP.NET Core project.
I added .filenesting.json
file to solution folder with content:
{
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"root": true, //Also tried with false
"dependentFileProviders": {
"add": {
"pathSegment": {}
}
}
}
but it's not working even when restarting VS. I think it should work, based on this documentation.
Not sure if file nesting should be enabled or disabled.
Problem is I can not see solution settings in dropdown:
but it is under edit:
I also tried with custom setting (not solution) and it also doesn't work. What did I miss?
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.
After you update VS Code to v1. 64, file nesting is not enabled by default. Go ahead and do it by toggling the “File Nesting: Enabled” setting. If you do it while you have a project open, you might notice that the files package-lock.
I think the documentation is wrong here - that screenshot is missing the actual rules. I dug into it for Stack Overflow and hit the same thing...here's what actually works for your case in .filenesting.json
:
{
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"root": true,
"dependentFileProviders": {
"add": {
"pathSegment": {
"add": {
"Help.*": [ ".cs" ]
}
}
}
}
}
The only important diff (AFAIK) is the actual rule "add"
itself.
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