I added two partial classes that have the same name:
public partial class SomePartial
{
}
and now I have two separate files.
I want to make them appear as single item in the project, that can be expanded like in a WebForms project where you have the Form.cs
and you have the Form.Designer.cs
.
You can do this by editing the .csproj-file by hand.
Right-click the project and select "Unload project", then right-click it again and choose "Edit .csproj".
This is an .xml file which describes your project and its dependencies. You need to find the entries that describe the files of your partial class, e.g.
<ItemGroup>
<Compile Include="MyPartialClass.cs" />
<Compile Include="MyPartialClass.Extension.cs" />
</ItemGroup>
Now you can set one as a sub-item of the other by adding a DependendUpon
subtag:
<ItemGroup>
<Compile Include="MyPartialClass.cs" />
<Compile Include="MyPartialClass.Extension.cs">
<DependentUpon>MyPartialClass.cs</DependentUpon>
</Compile>
</ItemGroup>
Save the file, and re-load the project.