I have a .NET Standard 2.0 project which depends on another project targeting "net6.0-windows;net48". The other project uses a NET6 WindowsAPICodePack Nuget package.
When I build the solution, the other project builds fine but the depending project gets this error about WindowsAPICodePack being restored for the old .NET Framework.
Warning As Error: Package 'WindowsAPICodePack 7.0.4' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
How can I force it to restore the package for .NET6/Standard2.0?