In web projects you have the option of nesting files
+ startup.cs
+--startup.internals.cs
+--startup.configuration.cs
Is there any
I believe you can do this in your csproj file.
<Compile Include="startup.cs">
<DependentUpon>startup.internals.xaml</DependentUpon>
<DependentUpon>startup.configureation.xaml</DependentUpon>
</Compile>
To answer your Updates : Partially solved:
Something similar to this issue.
DependentUpon
is the correct element to use to achieve the nesting that you want.
But, your value cannot be expression that includes wildcards. It must be a single file that is under the same folder or a sub-folder. If your file exists in a sub-folder, you must specify the file via a relative path. So the content of your ItemGroup
should be like this:
<Compile Include="Folder_A\Folder_A1\startup.cs" />
<Compile Include="Folder_A\Folder_A1\startup.configuration.cs">
<DependentUpon>startup.cs</DependentUpon>
</Compile>
<Compile Include="Folder_A\Folder_A1\startup.internals.cs">
<DependentUpon>startup.cs</DependentUpon>
</Compile>
And after my check, I think you need to use the Include
attribute instead of Update
if you are building a .NET FX class library project.
Update:
The Update
attribute is available only for .NET Core projects according to this doc.
And if in a .NET Core project, like what you indicated in a comment, maybe Update
is more suitable:
<Compile Update="Folder_A\Folder_A1\startup.internals.cs">
<DependentUpon>startup.cs</DependentUpon>
</Compile>