Skip to content

Cannot customize file nesting between xsd and cs files #8791

@Vrlwrox

Description

@Vrlwrox

Visual Studio Version

17.3.4

Summary

I'm trying to nest .xsd files under .cs files.

The rules in .filenesting.json seem to have no effect on nesting between .xsd and .cs file. I've tried adding root node and set it to true, also adding remove node under dependentFileProviders, filling it with all the providers.

None of that worked worked and the .cs files are always displayed under .xsd files. This is also true when file nesting is disabled (with or without custom rules), so I'm thinking the .xsd rule is probably hard-coded. Also, creating a custom settings based on defaults, I can see no .xsd rule, further indicating that it is hard-coded somehow.

When file nesting is enabled and .filenesting.json is present, I also get a compilation warning "Some files inside the project '<project_name>' are nested under each other, and form a loop. Review the file nesting rules."

Steps to Reproduce

  1. Create a .cs and .xsd files with same name in .NET 6 project
  2. Create a .filenesting.json in solution or project folder (changing/removing root and/or removing dependentFileProviders.remove parts will have no effect)
    { "root": true, "dependentFileProviders": { "remove": { "extensionToExtension": {}, "fileSuffixToExtension": {}, "addedExtension": {}, "pathSegment": {}, "allExtensions": {}, "fileToFile": {} }, "add": { "extensionToExtension": { "add": { ".xsd": [ ".cs" ] } } } } }
  3. Open the project, enable file nesting and compile. You should see a yellow warning icon on .xsd files in solution explorer and a warning

Expected Behavior

Nest .xsd files under .cs files.

User Impact

Slight annoyance because I see new features that seem they can be useful, only to have my hope soiled and my dreams shattered by a bug or an oversight :-D

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions