This error is being generated when I compile my xUnit project. The project compiled properly prior to adding the Esri.ArcGISRuntime.Toolkit.Maui package to my MAUI library that is being tested.
I cannot figure out what it thinks is being compiled as an EXE. As stated above the xUnit project is referencing library projects, not EXE projects. I went so far as to unload the EXE project as well. The error still occurs.
Any ideas?
Thanks!
Change the unit test project targetframework from "net7.0" to "net7.0-windows10.0.19041.0".
Thanks for the tip @dotMorten_esri , but unfortunately it does not work for me. Were you able to make this work? There is an Open bug reported here on this: https://github.com/dotnet/maui/issues/11575
This is the same error message I receive when trying your suggestion. With the difference that it references net7.0 instead net6.0.
The Maps SDK for .NET only supports the base .net7 target for class libraries. When you go to execute at runtime, it requires a platform identifier so the correct native libraries gets deployed and are available at runtime.
I'm guessing the issue you're referring to is related to that .NET MAUI deploys on Windows as a packaged app, and your test runner (and commandline parameters) must support this.
Which test framework are you using?
I'm using XUnit and running the app within Visual Studio 2022 on Windows 11. Typically I run the tests through Resharper. But Microsoft Test gives the same error.