I have an annoying problem. Sometimes Visual Studio does not show option "View designer" for some of my forms in solution explorer. It does not show design mode errors, just doesn't show option to use the designer. I cannot figure out exact cases when this happens.. Does anybody have some ideas about what causes such behavior of solution explorer?
This will occur if the first class in the source file is NOT the "partial class" for your form. In this case the file type icon in solution explorer will initially display as a form but VS will change it to the "C#" code icon after it has loaded the file and also remove the "View Designer" option from the popup menu. At least in VS2015 this can be fixed by commenting out the offending code and saving the file at which time VS will restore the expected form icon.
I've had this problem too, i've modified the .csproj file to fix it. In my .csproj file i modified this line of code:
<Compile Include="FormName.cs" />
With this code:
<Compile Include="FormName.cs">
<SubType>Form</SubType>
</Compile>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With