views:

32

answers:

2

Hey,

So I'm throwing this random question out there to see if anybody can or has done this in the past.

I'm looking at tidying up my project layout in Visual Studio and I'm wondering if there is any hack, plugin or trick to associate an .xml file with a .cs file of the same name so they appear grouped in my solution navigator/explorer.

similar to the way the code-behind file is associated with its aspx.

alt text

I know this is a bit random, but any suggestions welcome.

Thanks

A: 

You have to implement the IVSSingleFileGenerater interface supplied with VS. I dont know all the details, but searching for that interface will point you in the right direction.

leppie
+4  A: 

In your project file :

<Compile Include="FileA.cs"/>
<Compile Include="FileA.xml">
  <DependentUpon>FileA.cs</DependentUpon>
</Compile>

Or you could use Group Items command of VSCommands 2010 extension.

madgnome
Perfect! I didn't really think it would be possible
mjmcloug