For Windows Hosting Packages

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

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

.NET 6.0
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
.NET 7.0
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

.NET 8.0

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</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 (Core) 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 6.0 to 7.0
Migrate from ASP.NET Core 7.0 to 8.0