我想使用 .NET 8 创建一个新的 WinUI 3 桌面应用程序。在 Visual Studio 中初始化项目后,该项目位于 .NET 6 上。我将 .csproj 文件的 TargetFramework 从 更改为net6.0-windows10.0.19041.0,net8.0-windows10.0.19041.0但弹出此错误。如何使用 .NET 8 解决此问题?
错误:
NETSDK1083: The specified RuntimeIdentifier "win10-x86" is not recognized
NETSDK1083: The specified RuntimeIdentifier "win10-x64" is not recognized
NETSDK1083: The specified RuntimeIdentifier "win10-arm64" is not recognized
Run Code Online (Sandbox Code Playgroud)
我的.csproj文件:
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>SudokuEngineApp</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
我尝试过 .NET 7 并且它有效:
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
而 .NET 8 则不然。