A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Change the project to target a supported .NET version and then reload the Windows Forms designer.
- Open the project file (.csproj or .vbproj) in an editor (in Visual Studio, right-click the project → Edit Project File).
- Locate the
<TargetFramework>(or<TargetFrameworks>) element that is currently set tonet5.0(ornet5.0-windows). - Replace it with a supported target framework, for example:
or another currently supported version according to the .NET support policy.<TargetFramework>net8.0-windows</TargetFramework> - Save the file and reload the project in Visual Studio.
- Rebuild the solution so that all references and designer-generated code are updated.
- Reopen the Windows Forms designer.
If the project is Windows Forms or WPF and still uses the older WindowsDesktop SDK, update it to use the unified .NET SDK and a Windows-specific TFM. For example, change:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
into something like:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
.NET 5 is out of support, so targeting a later supported version (for example, .NET 8) both restores designer support and ensures continued security updates. If remaining on an out-of-support framework for a time is unavoidable, the SDK can suppress the end-of-support warning by setting CheckEolTargetFramework to false, but this does not restore support or security updates and is not recommended for long-term use.
References: