Jeremy
Jeremy

Reputation: 4848

Visual Studio 2008 not nesting files properly in solution explorer

I have a VS 2008 WinForms project, and I recently added an existing form that was developed in a different VS 2008 project. All of the original forms and controls are nesting correctly, however, with the new form, it is showing the form, designer and resx files as 3 separate items.

Is there a way to force VS to nest these files properly? I've been through the settings, googled, been to MSDN, and can't seem to find information on this.

Upvotes: 3

Views: 1431

Answers (2)

Hans Passant
Hans Passant

Reputation: 942128

Edit the .csproj file with, say, Notepad. The <DependentUpon> elements are missing.

Upvotes: 1

VoodooChild
VoodooChild

Reputation: 9784

Assuming the new form is called "Form1" should look like this for it:

<Compile Include="Form1.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Form1.Designer.cs">
      <DependentUpon>Form1.cs</DependentUpon>
    </Compile>
    <EmbeddedResource Include="Form1.resx">
      <DependentUpon>Form1.cs</DependentUpon>
    </EmbeddedResource>

Upvotes: 2

Related Questions