In my case right-click on Form1.cs (with correct Form icon) and select "View Designer" still showing code.
I found this thread and realized I accidentally choose .Net Core instead of .NET Framework when creating new project:
I should able see this long xml inside .csproj file (.NET Framework) of Solution Explorer panel, which the TargetFrameworkVersion
showing v<Number>
:
...
<OutputType>WinExe</OutputType>
<RootNamespace>HelloWorld</RootNamespace>
<AssemblyName>HelloWorld</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
...
, instead of short xml below (*.Net Core), which the TargetFramework
showing netcoreapp<Number>
:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
To check project type, can refer this answer.
Microsoft devlogs stated that Designer with .Net Core is not shipped by default yet:
If you want to work with .NET Core project, don’t forget to install
the .NET Core Windows Forms Designer, since it isn’t yet shipped
inside Visual Studio by default. See the previous “Enabling the
designer” section.