This macro enables you to nest project items inside Visual Studio .NET. Until now, there is no easy way to nest project items through the Visual Studio IDE, you can only do it by manipulating the project (.csproj or .vbproj) file and adding the DependentUpon element.

Inside the IStaySharp.vsmacros file there is a macro called ‘Create Dependency’ which allows you to nest two selected items. I have even created a video to illustrate how to configure and use the macro.

I’ve been trying to figure out for months why this doesn’t just work automatically with files named in certain patterns indicating partial class usage (Class1.cs, Class1.Static.cs). At least now I have a way to do it manually.