Form showing as a class in Solution Explorer

0 votes
asked Apr 28, 2009 by norlando

I have a form in my project that is showing up as a class in Solution Explorer. This is causing a problem since I can't get to the designer. Any ideas on how to fix this?

6 Answers

0 votes
answered Apr 28, 2009 by anton-gogolev

Press F7 when in code editor to get to the designer. And restarting Visual Studio usually helps.

0 votes
answered Apr 28, 2009 by jwarzech

Try seeing if there are any hidden files by using the the 'Show All Files' button. Sounds like your project file might not have all of the files added to it.

0 votes
answered Apr 28, 2009 by chris-dunaway

One thing that has worked for me in the past is to just add another blank form to the project and that seemed to make the other form show up as a form. You can then delete the blank form.

I don't know if it will work for you, but it only takes a few moments to try it.


0 votes
answered Apr 28, 2009 by craig-t

You can fix the problem manually by editing your csproj file.

Open it in notepad and search for the filename of the class. You should see something like this...

<Compile Include="frmTest.cs" />

Add a subtype called 'Form' like this...

<Compile Include="frmTest.cs">

Reload the project. Visual Studio should now identify the file correctly.

0 votes
answered Apr 25, 2011 by jayastuhan

remove the reference of form related dll and again add and build the project

0 votes
answered Sep 15, 2017 by sabbir-ahmed-saif

Simply select the form and press Shift+F7. You'll find your form.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter