I would like to create a new WinUI 3 desktop application using .NET 8. After I initialze the project in Visual Studio, the project is on .NET 6. I change the .csproj file’s TargetFramework from net6.0-windows10.0.19041.0
to net8.0-windows10.0.19041.0
, but this error pops up. How can I solve this issuewith .NET 8?
The errors:
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
My .csproj
file:
<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>
I have tried with .NET 7 and it worked:
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
With .NET 8 it doesn’t.
Well, after a bit of searching, I found the solution, that works for me.
The official Microsoft documentation says:
Use portable RIDs, for example,
linux-<arch>
,linux-musl-<arch>
,osx-<arch>
, andwin-<arch>
.
So I changed the RuntimeIdentifiers
and the PublishProfile
.
The “10” had to be removed. Like win10-x64
to win-x64
.
My modified .csproj
is the following:
<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>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
</PropertyGroup>
Try these steps to upgrade to .NET 8:
-
Download and install the .NET 8 SDK.
-
Edit the *.csproj file.
TargetFramework
: net8.0-windows10.0.19041.0RuntimeIdentifiers
: win-x86;win-x64;win-arm64PublishProfile
: win-$(Platform).pubxml- Add
UseRidGraph
and set it totrue
.
For example:
<PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> <RootNamespace>WinUI3App</RootNamespace> <ApplicationManifest>app.manifest</ApplicationManifest> <Platforms>x86;x64;ARM64</Platforms> <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers> <PublishProfile>win-$(Platform).pubxml</PublishProfile> <UseRidGraph>true</UseRidGraph> <UseWinUI>true</UseWinUI> <EnableMsixTooling>true</EnableMsixTooling> <Nullable>enable</Nullable> </PropertyGroup>
These steps might be changed/improved in later versions of WindowsAppSDK. Check this from the release notes.
Does this answer your question? NETSDK1083: The specified RuntimeIdentifier “win10-x64” is not recognized. Specifically, see the answer from Ryan
I saw that, but not help me. I had to search for the answer and I found it.
So the bit in the linked answer “you can see that you now need to use win-x64.” didn’t help even though that’s exactly what you stated in your answer? Don’t just look at the accepted answer.