In web projects you have the option of nesting files
+ startup.cs
+--startup.internals.cs
+--startup.configuration.cs
Is there any way to achieve the same behavior in a class library project as well ?
Updates : Partially solved
Ok got it ,
You need to be aware of your files path.
for a structure like this (the files are at project level)
+-- myProject.csproj
+-- startup.cs
+-- startup.internals.cs
+-- startup.configuration.cs
Then this is the configuration you are looking for.
<ItemGroup>
<Compile Update="startup.*.cs">
<DependentUpon>startup.cs</DependentUpon>
</Compile>
</ItemGroup>
For a nested folder structure
+-- myProject.csproject
+-- Folder_A
+-- Folder_A1
+-- startup.cs
+-- startup.internals.cs
+-- startup.configuration.cs
you need to get hold of the project path using the buildin $(ProjectDir) macro
<ItemGroup>
<Compile Update=" $(ProjectDir)\Folder_A\Folder_A1\startup.*.cs">
<DependentUpon> $(ProjectDir)\Folder_A\Folder_A1\startup.cs</DependentUpon>
</Compile>
</ItemGroup>
Why do I say it is partially working, well because if I exit Visual and then open it again, for the 2nd type of structure, it will un-nest the files.
Some help anyone ?