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

Livecharts crash WindowsSdkPackageVersion 10.0.22621.38+ #1580

Open
Bush-cat opened this issue Sep 3, 2024 · 12 comments
Open

Livecharts crash WindowsSdkPackageVersion 10.0.22621.38+ #1580

Bush-cat opened this issue Sep 3, 2024 · 12 comments
Labels
bug Something isn't working requires external features We can not fix this for now, we need a feature that is out of this library.

Comments

@Bush-cat
Copy link

Bush-cat commented Sep 3, 2024

Describe the bug
When loading the Livecharts in XAML in an App with WindowsSdkPackageVersion 10.0.22621.38 or higher it crashes the App and Debugger. WindowsSdkPackageVersion 10.0.22621.34 and lower work as expected

I encountered this when I wanted to update CommunityToolkit.Mvvm from 8.2.2 to 8.3.0, I had to increase WindowsSdkPackageVersion (Microsoft.Windows.CsWinRT 2.1.1 also requires a higher version!)

CommunityToolkit.Mvvm 8.3.0 features many changes like .net8 and other things were made optional.
https://devblogs.microsoft.com/dotnet/announcing-the-dotnet-community-toolkit-830/

To Reproduce
Steps to reproduce the behavior:

  1. Set 10.0.22621.38 in Solution
  2. Make a XAML page with a livechart
<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:lvc="using:LiveChartsCore.SkiaSharpView.WinUI"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <lvc:CartesianChart />
    </Grid>
</Page>
  1. Run the app / open the Page
  2. See App and debugger crash, it didn't even save an unhandled exception

Desktop (please complete the following information):

  • OS: Windows 11 Build 22631
  • Build 22631

Additional context
LiveChartsCore.SkiaSharpView.WinUI 2.0.0-rc2.1
net8.0-windows10.0.22621.0
Microsoft.WindowsAppSDK 1.5.240802000

@Bush-cat
Copy link
Author

Bush-cat commented Sep 5, 2024

So Windows App SDK 1.6 finally released but it also requires the new SDK

This version of the Windows App SDK requires Microsoft.Windows.SDK.NET.Ref 10.0.22621.38 or later.

@torum
Copy link

torum commented Sep 5, 2024

yap same here. I got 'System.NotSupportedException' (inside WinRT.Runtime.dll) and 'System.Reflection.TargetInvocationException' (inside System.Private.CoreLib.dll) exceptions after upgrading WinAppSDK to 1.6.

@TRadigk
Copy link

TRadigk commented Sep 9, 2024

Same issue here, can't either use newer Windows App SDK Version or this Charts Control. Please fix the problem and update the package 😊

@beto-rodriguez beto-rodriguez added requires external features We can not fix this for now, we need a feature that is out of this library. bug Something isn't working labels Sep 10, 2024
@beto-rodriguez
Copy link
Owner

The problem is that LiveCharts uses the SKXamlCanvas from SkiaSharp to render the chart, this control is the one throwing.

Since WinAppSDK 1.6 is relatively new, this is probably something that will be updated soon by someone in the MS team.

Sadly, I am afraid that there not much this library can do here :( we need to wait for MS to update the dependencies of this library.

@TRadigk
Copy link

TRadigk commented Sep 12, 2024

Did you address this issue with the devs at WindowsAppSdk at github?

@beto-rodriguez
Copy link
Owner

beto-rodriguez commented Sep 18, 2024

@TRadigk not sure if the issue is on WindowsAppSdk or SkiaSharp, for now I raised the issue to SkiaSharp.

mono/SkiaSharp#3007

@Bush-cat
Copy link
Author

I guess we need to wait until the Library supports Skiasharp v3 since the new rc version does not work with it yet
Cannot create instance of type 'LiveChartsCore.SkiaSharpView.WinUI.CartesianChart'

I’ve been using your Library and appreciate your work. I noticed there was a long gap in updates before the last release candidate and 2.1 and wanted to ask if there could be more frequent updates to the repo or dev branch, at the moment it seems there's only a push when a new release was published.
I'm very interrested in seeing development happen, as this library has a lot of potential but when writing the Issue I got slightly worried the development was stalled.
I don’t mean to pressure you or ask for new builds for every change and I don’t mind force pushes on a dev branch.

@beto-rodriguez
Copy link
Owner

My plan is to maintain the library in the long term.

About frequently updates, normally I do, but as an open source project completely maintained by my resources (mostly time), sometimes things could get slower than usual. The plan is to also offer a paid version that will mitigate this effect.

About SkiaSharp 3, I really hope that this fix also comes to 2.x, because as far as I have read, there will be a lot of breaking changes in the 3.x version, I haven't seen if those changes affect the library, but I am aware that they are working in making the migration not so painful, the library will be updated to SkiaSharp 3 for sure, when? Well it depends on the effort required to do it.

@beto-rodriguez
Copy link
Owner

I guess we need to wait until the Library supports Skiasharp v3

Just to be clear, this issue is also present in the latest release of SkiaSharp 3

mono/SkiaSharp#2999

@Bush-cat
Copy link
Author

I found a reply of the Person who wrote the fix commit about 2.x

Since that is still preview and SkiaSharp is stable, I cannot really depend on it for SkiaSharp 2.x. However, the 2.x branch does not have the convenient native library that I can use. I technically can add it to 2.x but that is a lot of work, and that old branch is very iffy to build.
microsoft/CsWinRT#1645 (comment)

@Bush-cat
Copy link
Author

Bush-cat commented Sep 24, 2024

Today I tried building managed Skiasharp 2.x from source so I can patch it. I invested 3hours but it's a big mess, soo many outdated and eol things cause lots of errors, was able to supress and fix some but it's too much, at the moment I am at 237 Errors x_x.

I think I better invest the time in migrating the Library to Skiasharp 3.0 when I get the time, the patched package might not be in nuget yet but you can get it from their azure build server

@scr47One
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working requires external features We can not fix this for now, we need a feature that is out of this library.
Projects
None yet
Development

No branches or pull requests

5 participants