oxyplot / oxyplot-xamarin

OxyPlot for Xamarin.Mac and Xamarin.Forms
MIT License
64 stars 59 forks source link

Mismatch version Oxyplot.Xamarin.Forms targetting Oxyplot.Core 2.0.0 #124

Closed TrsGianni closed 1 year ago

TrsGianni commented 2 years ago

Hello, I'm generating a model using Oxyplot.Core 2.1.0 in a seperate project and want to add this model to a view with WPF and Xamarin.Forms, there's no problem with WPF but but because of the mismatch in versions between Oxyplot.Xamarin and my project generating the model (Oxyplot.Xamarin targetting Oxyplot.Core 2.0.0) I'm getting the following error:

System.TypeLoadException Message=Type OxyPlot.Xamarin.Android.CanvasRenderContext has invalid vtable method slot 7 with method OxyPlot.RenderContextBase:DrawLine (System.Collections.Generic.IList`1,OxyPlot.OxyColor,double,OxyPlot.EdgeRenderingMode,double[],OxyPlot.LineJoin)

Is there any news regarding the update to 2.1.0? Or is there a work-around? I tried setting the Oxyplot.Core target of the Oxyplot.xamarin projects to version 2.1.0 but I'm getting a lot of errors (not implemented methods etc.)

janusw commented 1 year ago

Is there any news regarding the update to 2.1.0? Or is there a work-around?

The only workaround for now would be using OxyPlot 2.0.0 in your project (unless you need any features from 2.1.0).

In fact I plan to update Oxyplot.Xamarin.Forms to OxyPlot 2.1.0 eventually, but I don't know much work it will be and if there are any major obstacles, so I don't have any timeline for you ...

VisualMelon commented 1 year ago

@janusw porting to 2.1 should be trivial: there is one important API change you'd need to worry about, but it's easy to update.

janusw commented 1 year ago

@janusw porting to 2.1 should be trivial: there is one important API change you'd need to worry about, but it's easy to update.

Thanks for the comment. I'll look into that soon (once I'm done with the cleanup and updating for 2.0).

janusw commented 1 year ago

Btw, @TrsGianni, which OxyPlot.Xamarin.Forms version did you use? You could try if the 2.0.0-beta.1 package that we published recently works any better, or if it still gives you the same error message.

janusw commented 1 year ago

142 is merged by now and should fix this issue. You can try the nupkg from https://github.com/oxyplot/oxyplot-xamarin/actions/runs/3869117717#artifacts. I will prepare a 2.1.0 release soon.