Description
I tried to upgrade from SkiaSharp.Views.Forms 1.68.0 to 1.68.1 but I couldn't because the former provided a lib/netstandard1.3 folder, while the new version doesn't provide any netstandard libs (I only see folders MonoAndroid, Xamarin.Mac20, Xamarin.iOS, tizen40 and uap10.0).
(FYI I need this to be able to run a Xamarin.Forms app under GTK platform, i.e. Linux)
I have almost similar problem.
Since moving from 1.68.01 to 1.68.1, I cannot override SKCanvasViewRendererBase at the UWP project. Decompiling points me always to the Mono version.
@knocte The netstandard library is actually moved to the ref folder so that the compiler never copies it to the device. It was done to solve https://github.com/mono/SkiaSharp/issues/1011. You typically should not be using the netstandard library directly as it contains stub methods / missing methods as it is just for reference only.
But... If it is working for you, then maybe we can have a look at splitting the assembly into two - one that is a "base" assembly in the lib folder for all to use and one that is in the ref folder so that it does not conflict with the platform.
We can't move it back because of #1011 in which there are two assemblies with the same name and the first (which is the netstandard) is always picked. Moving it to the ref folder means that the platform assembly is picked. It might have been working for you because you have a different assembly name for GTK?
Another options is that you can send in a PR with the code you are using for GTK and we can have a look at merging that in - then you don't need to worry about that anymore.
@lothargrieb We just spotted that in #1042 and a fix is in #1044. I have pushed out a fix to the preview feed:
https://aka.ms/skiasharp-eap/index.json
Try version 1.68.1.1-preview.2 as that should have the fix. _(there is a 1.68.2 series, but that is actually older because I decided to get .1.1 out first with this fix)_
Another options is that you can send in a PR with the code you are using for GTK
Not sure what you mean with this? I just use SkiaSharp.Views.Forms in my project because one single static method I make use of: SkiaSharp.Views.Forms.Extensions.ToSKColor(). I'm sure this can be made available in a .netStandard binary which works across all platforms, or am I missing something?
Is this related to https://github.com/mono/SkiaSharp/issues/379 ? I don't understand how this has worked before.
This used to work because I had the nuget install the netstandard dll into platforms that were not supported. This was incorrect behavior because if you were to install the WPF nuget or the (hopefully soon) GTK nuget you would get duplicate dlls - the one from the core forms and the one from the WPF/GTK nuget. In addition, several paths would also throw exceptions
See https://github.com/mono/SkiaSharp/pull/1012
It used to work because there was no WPF nuget to cause this issue.
If you are using just one single static method, I would really suggest just adding this extension method directly into your project instead of referenceing the NuGet with is not supported in this scenario:
https://github.com/mono/SkiaSharp/blob/master/source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/Extensions.cs#L63-L66
The SkiaSharp.Views.Forms NuGet is only supported in Android, iOS, macOS, UWP and Tizen platforms. There is a separate package for WPF. All other uses are not supported and will cause issues if used.
I have created an issue to actually track this implementation.
Closing this for now as this is "technically" a regression as a result of fixing a bug. It was also not a supported pattern. For GTK, we will be getting a new NuGet that has much more features #1089
As a result, this particular use case will be addressed at some point with #1065, but not right now. The progress will be tracked on that issue.
Most helpful comment
@lothargrieb We just spotted that in #1042 and a fix is in #1044. I have pushed out a fix to the preview feed:
https://aka.ms/skiasharp-eap/index.json
Try version 1.68.1.1-preview.2 as that should have the fix. _(there is a 1.68.2 series, but that is actually older because I decided to get .1.1 out first with this fix)_