Did you check the official document about Publish a .NET MAUI app for Windows. When I used
dotnet publish -r win-x64 --output "<publishdir>
, I got the RuntimeIdentifier error. But I can use dotnet publish -f net9.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None
to publish the app.