How to group partial class files in Solution Explorer VS2010 [duplicate]
If you open your .csproj
as a text file (or choose "Unload Project" from the context menu in Solution Explorer for the project, followed by "Edit myproject.csproj") you can change it to show the relevant files in Solution Explorer in the style you wish.
Look for:
<Compile Include="CustomerServiceDao.cs" />
<Compile Include="CustomerServiceDao.Query.cs" />
And edit it to be as this:
<Compile Include="CustomerServiceDao.cs" />
<Compile Include="CustomerServiceDao.Query.cs">
<DependentUpon>CustomerServiceDao.cs</DependentUpon>
</Compile>
There's no way to do this directly within the Visual Studio editor, but given the extensibility model that VS2k10 provides, it probably won't be long before someone produces something.
Update: The latest version of VSCommands claims to support doing this for you:
Latest version supports grouping items from IDE (so you don't have to hand-hack project file with DependentUpon).
If you do not want to slow down you IDE with heavy and proprietary VSCommands extension you can use small extension NestIn instead. It can nothing but group/ungroup files
You can achieve this if you manually edit your .csproj
file.
Just right click you project, hit Unload Project
.
From there, right click and hit Edit project.csproj
Look for the Compile
elements. Add a DependentUpon
sub-element like this:
<Compile Include="CustomerServiceDao.cs" />
<Compile Include="CustomerServiceDao.Query.cs">
<DependentUpon>CustomerServiceDao.cs</DependentUpon>
</Compile>