Skip to content

.NET 7 and .NET MAUI

David Ortinau edited this page Sep 20, 2022 · 5 revisions

.NET MAUI is now available in .NET 7 beginning with release candidate 1 (RC1). We recommend using Visual Studio 17.4 Preview 2.1 or newer.

.NET 6 projects will continue to build with .NET 6 target framework monikers (TFM) from a .NET 7 RC1 installation.

To update your projects to .NET 7, edit the csproj file and replace net6.0 TFMs with net7.0, delete the bin and obj files, and restart Visual Studio to restore .NET 7 dependencies cleanly.

To pin your applications to .NET 6 and build from the .NET 6 instead of .NET 7 installation, use a global.json within your project directory.

{
    "sdk": {
      "version": "6.0.400",
      "rollForward": "latestMinor"
    }
  }

Note The exact version might be different when you're reading this, but the rollForward setting makes sure that it uses the latest .NET 6 version that is installed on your system. The .NET version might be a prerelease, in that case make sure to add "allowPrerelease": true as well. Also see: https://docs.microsoft.com/dotnet/core/tools/global-json