5 .NET 7 and .NET MAUI
David Ortinau редактировал(а) эту страницу 2022-09-20 13:43:36 -05:00

.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