I am using a class library for tests and I need to configure DryIoc, so I reference the Nuget package Prism.DryIoc. Note that I am working on a Xamarin solution and do not have (or need) any WPF (or other Windows) components.
When my class library is set to .NET Core 3.1, it compiles correctly. If I change it to .NET 5.0 or .NET 6.0 however, I get this error:
Error NETSDK1136 The target platform must be set to Windows (usually by including '-windows' in the TargetFramework property) when using Windows Forms or WPF, or referencing projects or packages that do so. C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.Shared.targets 250
When I review the references from Prism.DryIoc I see that it references Prism.Wpf.
Does anyone know a way to complete remove any Wpf dependencies, so that I can compile my library directly with .NET 6.0 without issues and without having to specify Windows as target framework?
Steps to reproduce:
- Open Visual Studio 2022
- Create a new project of type Class Library targeting .NET 6.0
- Add Nuget reference to the newest Prism.DryIoc (8.1.97 at the moment)
- Rebuild (sometimes a second rebuild it needed to see the error)
Sample class library attached.