Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have encountered a problem that appeared this morning. I have a Windows Forms project, but within the "Form1"; file folder, the Form1 class file that contains my code (that usually can be accessed in the by double-clicking on the "Form1" class file) - have suddenly disappeared from the Solution Explorer.

I can, however access it by right-clicking on the Form1 folder and selecting "View code" or by pressing F7. I have opened multiple different solutions but the problem remains in all of them. The only files shown within the "Form1"-class folder are Form1.Designer.cs and Form1.resx.


Do you guys have any idea how to "reset"; the Solution Explorer window to behave as before? I attached a screenshots of my Solution Explorer view, after selecting "View".

How it used to look like:
http://i.stack.imgur.com/MykCX.gif[^]

How it looks like now (The "Form1"-code view shortcut is missing):
http://i.stack.imgur.com/60oIO.png[^]

I´m looking forward to hear your thought regarding this.

What I have tried:

I tried to "repair" Visual Studio Community 2015, but the problem remains.
Posted
Updated 10-Sep-16 6:20am
Comments
David_Wimbley 10-Sep-16 7:55am    
It looks like you went from VS2013 to VS2015...are you sure that isn't your problem?
Philippe Mori 10-Sep-16 23:58pm    
Both images show the same 3 Form1.* files. What is the problem?
Philippe Mori 11-Sep-16 0:05am    
Double clicking on Form1.cs will show the designer (if the project was not modified).

If you want to see code, you use the contextual menu or keyboard shortcut.

Obviously, you are not a good observer since Visual Studio has always worked that way as far as I know.

Right click on the hidden file and include it to the project/ solution. Somehow the file got excluded from the project.

No need to reset vs settings.
 
Share this answer
 
Try these

Click the Project File -> under the Solution Explorer text, cick -> show all files and Refresh

Right click the files and click "Include in project"

Clean 
the Solution and Rebuild again.

If still the same issue persisits
Create a new form and Copy paste the content from existing files to new one.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900