In "old school" MSBuild projects - as still used by Windows Forms in VS2017 for example - files could be "nested" via a DependentUpon
item in the csproj file.
I used this to group unit tests together in Noda Time, e.g.
<Compile Include="LocalDateTest.PeriodArithmetic.cs">
<DependentUpon>LocalDateTest.cs</DependentUpon>
</Compile>
That led to easily-navigable tests:
I knowingly "lost" this feature when moving to project.json
for .NET Core, but had hoped it would return when converting to MSBuild. However, it looks like MSBuild projects based on the .NET Core SDK (root element <Project Sdk="Microsoft.NET.Sdk">
) don't get the same treatment in Visual Studio 2017, even if an ItemGroup
is added manually with the same elements as the "old school" project.
ASP.NET Core projects receive automatic nesting for minified CSS and Javascript, but it's not clear how to apply that to C# in .NET Core library projects.