I have a WinUI Project that uses the same Projects as a .net MAUI Mobile app. When I try to build the WinUI project on Azure DevOps I get this errors:
project.assets.json' doesn't have a target for 'net6.0/win10-x64'. Ensure that restore has run and that you have included 'net6.0' in the TargetFrameworks for your project. You may also need to include 'win10-x64' in your project's RuntimeIdentifiers
But my projects are targeting .net 6 in general and do not contain platform specific code:
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<nullable>enable</nullable>
</PropertyGroup>
I can solve this by adding this RuntimeIdentifiers:
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
But those cause issues with the build of my mobile applications. I also tried to make this conditional without success:
<RuntimeIdentifiers Condition="'$(TargetFramework)' == 'net6.0-windows10.0.22621.0'">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
Does anyone have an idea why WinUI needs those specific RuntimeIdentifiers when there is no platform specific code in a project and how I can circumvent that?