First I created a class file named Bootstrap.cs
, then I created another class name Bootstrap.Designer.cs
, the awesome part is Bootstrap.Designer.cs
become under of first class.
So I decide to create another class called Bootstrap.Sample.cs
But the problem here is the third class not become under of first class.
Is there any list of class naming exist like *.Designer.cs
that allowed to be under of first class?
You can do this using VSCommands plugin for Visual Studio. Simply highlight the two files, right click in Solution Explorer, and choose group.
If you want to do it manually you can right click on your project file in solution explorer, choose Unload Project. Then you can right click and edit the project, which will allow you to see the underlying XML. You're looking for
<Compile Include="yourfilename.cs" />
which you will need to change to
<Compile Include="yourfilename.cs">
<DependentUpon>parentFile.cs</DependentUpon>
</Compile>
This is described in How to group partial class files in Solution Explorer VS2010
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With