'How to use xUnit for MAUI projects for platform specific code?

I am having MAUI project and platform specific code for Android and Windows. When I reference the MAUI project to xUnit project in Visual Studio 2022 Preview, it shows an error saying "project is not compatible to net6.0", as the MAUI project references target frameworks "net6.0-android and net6.0-windows".

Is there any way introduced so that I can reference the MAUI project and unit test platform specific code?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source