SkiaSharp icon indicating copy to clipboard operation
SkiaSharp copied to clipboard

[FEATURE] Consider dropping OpenTK metapackage dependency from SkiaSharp.Views.WindowsForms

Open chrarnoldus opened this issue 1 year ago • 3 comments

Is your feature request related to a problem?

SkiaSharp.Views.WindowsForms has a dependency on the OpenTK metapackage, which pulls in OpenTK.Audio.OpenAL, OpenTK.Compute and OpenTK.Input even though they are not used by SkiaSharp.Views.WindowsForms (as far as I can tell).

Describe the solution you would like

Drop the dependency on the OpenTK metapackage. The dependency on OpenTK.GLControl will still transitively resolve everything that's needed (OpenTK.Windowing.Desktop etc.)

Describe alternatives you have considered

You can exclude OpenTK.Audio.OpenAL.dll, OpenTK.Compute.dll and OpenTK.Input.dll from your app package if you don't use them, but this is error prone because the compiler will think they are available and you might accidentally use them.

Additional context

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

chrarnoldus avatar Feb 03 '25 13:02 chrarnoldus

I propose consider doping this for WPF side too

c0nstexpr avatar Feb 10 '25 07:02 c0nstexpr

At least the package should be updated. Currently I get the following warnings when restoring the package using an net9.0-windows WPF project:

warning NU1701: Package 'OpenTK 3.3.1' 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 'net9.0-windows10.0.17763'. This package may not be fully compatible with your project.

warning NU1701: Package 'OpenTK.GLWpfControl 3.3.0' 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 'net9.0-windows10.0.17763'. This package may not be fully compatible with your project.

warning NU1701: Package 'SkiaSharp.Views.WPF 3.116.1' 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 'net9.0-windows10.0.17763'. This package may not be fully compatible with your project.

MovGP0 avatar Apr 21 '25 14:04 MovGP0

@MovGP0 that warning will probably go away if you increase your Windows target version from 10.0.17763 to 10.0.19041 (i.e. change your target framework to net9.0-windows10.0.19041).

I've asked before why specifically this version of Windows is required (https://github.com/mono/SkiaSharp/discussions/3151), but didn't get a reply. There doesn't seem to be a technical reason.

chrarnoldus avatar Apr 21 '25 14:04 chrarnoldus