Grouping autogenerated files to reduce clutter in Solution Explorer

When you create a form, Visual Studio creates two files for you: the Form.cs file and the Form.designer.cs file; they are grouped together.

You can do the same with the files auto-generated by Myxin. Unfortunately, Visual Studio won't let you do that visually, you'll have to edit the .csproj file by hand.
  • Exit Visual Studio
  • Make a backup of your .csproj file
  • Open the .csproj file in an independent text editor (Notepad)
  • Find the line corresponding to the autogenerated file. The line is in the form <Compile Include="MyControl.Mixin.DragAndDrop.cs"> and should be followed by more options for that file, then a </Compile> tag:

    <Compile Include="MyControl.Mixin.DragAndDrop.cs">
  • Between the <Compile> and </EndCompile> tag, add an option in the form <DependentUpon>MyControl.cs</DependentUpon>

    <Compile Include="MyControl.Mixin.DragAndDrop.cs">
  • Save the file and reopen the solution in Visual Studio
  • The MyControl.Mixin.DragAndDrop.cs file now appears as a child of MyControl.cs:


You can of course do that for all your autogenerated mixin files, and also for the .Glue.cs files added to the mixin template.

Last edited Jan 11, 2010 at 10:11 AM by sleclercq, version 4


No comments yet.