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

One thought on “Form Showing As Class In Visual Studio 2010 Solution Explorer

  1. Another cause for this is if you subclass another form that has compiler errors. To get your icon back, just rectify the errors and the icon will return.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s