1

I checked out a C# Windows Forms App (.NET Framework) from GIT and was looking around and making some modifications to the code and the form. At some point the next day I no longer have any View Designer or View Source in the View menu or when right-clicking the file in Solution Explorer. Also, double-clicking the file just brings up code view.

  • It successfully Builds, Executes, displays the form and functions correctly.

I can't find an option under File > New File (only Web Form) or anywhere else to add a new form and Solution Explorer shows:

enter image description here

I have done quit a bit of searching and everything seems to point to using .NET Core (which doesn't support Form Designer, without possibly an external package) instead of .NET Framework which is not my case.

If I create a new C# Windows Forms App (.NET Framework) I do have Form Designer and the ability to view code and form.

Is this a setting in the Project/Solution or in the IDE? How can I get Form Designer back? I'm not sure where to look to prove in the question that it is .NET Framework and not .NET Core, but forms were working yesterday.

AbraCadaver
  • 78,200
  • 7
  • 66
  • 87
  • What if you add a form to that broken project. Same issue? What kind of icons are you getting in your solution tree for those files? – LarsTech Apr 15 '20 at 18:57
  • @LarsTech Edited, thanks! I don't see where I can add a form. – AbraCadaver Apr 15 '20 at 19:03
  • Right mouse clicking PingServers folder should give you an option to add a new windows form. Does that Form1.cs file have any attributes above the class name when you look at the code? – LarsTech Apr 15 '20 at 19:10
  • @LarsTech Only New File, New Item, New Folder and searching in New Item for form only shows Web Form. Code https://pastebin.com/pyTvEuA4 – AbraCadaver Apr 15 '20 at 19:14
  • 1
    Click on the toolbar in your image to switch views from Folder View to Solution View. – LarsTech Apr 15 '20 at 19:23

1 Answers1

1

It looks like the view of your project got switched to Folder View.

Click on the Toolbar in the Solution Explorer and switch the view to Solution View.

enter image description here

LarsTech
  • 80,625
  • 14
  • 153
  • 225
  • Thanks, is this just quirky behavior or something that most users know or is documented? – AbraCadaver Apr 15 '20 at 19:41
  • 1
    @AbraCadaver I don't know if this is Visual Studio 2019 behavior or prior versions, too, but I came across this issue recently when checking out projects from our GitHub account at work. Once I noticed that "Folder View" in your image, it stirred my brain. – LarsTech Apr 15 '20 at 19:44