For Windows Hosting Packages

In this article, we will show you how to run the .NET in your Windows hosting package.

If you want to develop Web APIs, user interfaces, and other cloud-based applications using .NET, you must first add this setting to the PropertyGroup of your Microsoft Visual Studio project ($projectname).csproj).

.NET 6.0 (LTS)
<PropertyGroup>
  <TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

.NET 8.0

<PropertyGroup>
  <TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

This will load all of the necessary modules/packages that are required to run the .NET Core.

Note

We recommend the use of the latest version .NET 8.0 for your web projects. 

For applications still based on earlier .NET versions, Microsoft provides the following migration guides:

Migrate from ASP.NET Core 3.1 to 6.0
Migrate from ASP.NET Core 5.0 to 6.0
Migrate from ASP.NET Core 7.0 to 8.0