Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SkiaSharp.Wpf Visual Studio XAML designer crash #2075

Open
Enduteri opened this issue Apr 23, 2024 · 0 comments
Open

SkiaSharp.Wpf Visual Studio XAML designer crash #2075

Enduteri opened this issue Apr 23, 2024 · 0 comments

Comments

@Enduteri
Copy link

Enduteri commented Apr 23, 2024

Steps to reproduce

  1. Install nuget package OxyPlot.SkiaSharp.Wpf into any WPF project
  2. Add PlotView to MainWindow.xaml or any window
  3. Build project

Platform: WPF
.NET version: netf472
Oxyplot SkiaSharp Wpf version: 2.1.2
Visual Studio Community 2022 x64 17.9.6

Actual behaviour

Visual Studio designer crashes trying to load xaml file containing skia:plotview objects.
It's purely a designer problem, program can compile and run OK without designer
I've also tried this with x86 project build and AnyCPU, same issue
XAML designer crashes trying to create RenderContext, fails on libSkiaSharp.dll, file is present in the bin catalog
This crashes designer for the entire project, no way around it, won't be able to use it.

Workaround

Create PlotView in Control code and add to View when loaded

Error Details:

`System.DllNotFoundException
Dll was not found.

System.AggregateException
System.DllNotFoundException: Unable to load DLL 'libSkiaSharp': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at SkiaSharp.SkiaApi.sk_paint_new()
at SkiaSharp.SKPaint..ctor()
at OxyPlot.SkiaSharp.SkiaRenderContext..ctor() in C:\Users\Murdo\source\repos\oxyplot\Source\OxyPlot.SkiaSharp\SkiaRenderContext.cs:line 24
at OxyPlot.SkiaSharp.Wpf.PlotView.CreateRenderContext() in C:\Users\Murdo\source\repos\oxyplot\Source\OxyPlot.SkiaSharp.Wpf\PlotView.cs:line 52
at OxyPlot.Wpf.PlotViewBase.OnApplyTemplate() in C:\Users\Murdo\source\repos\oxyplot\Source\OxyPlot.Wpf.Shared\PlotViewBase.cs:line 190
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.LiveMarkup.TapInstanceManager.GetFrameworkElementNameScope(DependencyObject ancestor)
at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.LiveMarkup.TapInstanceManager.UpdateNameRegistration(TapInstanceBuilderContext context, XamlAction xamlAction)
at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.LiveMarkup.TapInstanceManager.ProcessCurrentThreadActions(TapInstanceBuilderContext context)
at Microsoft.VisualStudio.DesignTools.WpfTap.WpfVisualTreeService.LiveMarkup.TapInstanceManager.UpdateInstances(TapInstanceBuilderContext context)
at Microsoft.VisualStudio.XSurface.Wpf.DesignerTapInstanceManager.UpdateInstances(TapInstanceBuilderContext context)
at Microsoft.VisualStudio.XSurface.Wpf.Tap.SurfaceService.InstanceBuildDocumentInternal(Int32 documentId, Object rootObject)
at Microsoft.VisualStudio.XSurface.Wpf.Tap.SurfaceService.HandleCreateSurfaceInternal(CreateSurfaceRequestInfo requestInfo)
at Microsoft.VisualStudio.DesignTools.RuntimeHost.TapOM.ResponseWithError.ThrowIfFailed()
at Microsoft.VisualStudio.DesignTools.SurfaceDesigner.Documents.SurfaceIsolation.DesignerInstanceManager.d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.DesignTools.XamlSurfaceDesigner.Views.IsolatedSurfaceImageHost.d__67.MoveNext()

System.AggregateException
One or more errors occurred.`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant