Form Showing As Class In Visual Studio 2010 Solution Explorer

Sometimes while working on WinForms applications a very strange thing happens, when I add a new form to the project it shows up as a C# class. This is very annoying because I can not readily get to the design view for that form. Luckily there is a simple fix.

1. Unload the project.
2. Search for the specific form in the xml file.
3. Replace xml with following.

<Compile Include="[formname].cs">
    <SubType>Form</SubType>
</Compile>

4. Save and reload the project.

Advertisements