Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form can't be opened in designer Visual Studio 2015 (Using C#)

As per How do I open a Visual Studio project in design view?, Shift + F7 or F7 should show the design view, but i only get the code view.

Double clicking on Form.cs doesn't help either as mentioned in https://msdn.microsoft.com/en-us/library/w5yd62ts(v=vs.100).aspx.

Right clicking on Form1.cs does not display an option allowing me to open the design view

How can i open the design view? Options i get on right clicking Form1.cs

like image 646
Sam Wrayn Avatar asked Nov 27 '22 04:11

Sam Wrayn


1 Answers

Check your Form1.Designer.cs and Form1.cs files to make sure you haven't put another class in at the top of the file before your partial class Form1{ because the designer will only load if the Form class is the first class defined in the file.

You mentioned this solution as a comment to one of the answers but I tried performing the edits on the .csproj first before realizing that my changes were being reverted and I needed to remove the myCustomPropertyView class I'd lazily added to the top of the file.

Visual Studio was still acting a bit weird (telling me I had errors on lines which were fully commented out) but once I closed and re-opened Visual Studio I was back up and running.

like image 143
nvuono Avatar answered Dec 15 '22 15:12

nvuono