-
Notifications
You must be signed in to change notification settings - Fork 743
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
System.InvalidCastException: Unable to cast object of type ' XXXX' to type 'YYYY' #14453
Comments
Can you provide a repro please? |
Xaml:
|
Thanks. Make sure to provide all the details that are requested when creating a template, particularly the uno version that you're using. |
Are you using |
@ebariche Could this be theoretically related to your changes? |
@MartinZikmund I doubt so ! |
@jeromelaban I think some of the recent changes (specifically related to performance) assumed that certain code paths are only run in the UI thread. Could it be something running in a different thread causing a race? In the stacktrace in the original post here, there is |
It may, indeed. We do not have UI Thread checks in DependencyObject, but it may be interesting to enable them to validate if that's the issue. |
@sushuying521 Are you by any chance doing some asynchronous, non-UI thread work in your app by any chance? |
#13963 might be related. It's one of those performance optimizations that rely on code properly executing in the UI thread. If |
|
|
@sushuying521 Are you able to upload a project where this happens? |
If this is an error this is reported in 4.9.17 as well, this is likely not caused by recent changes. This may be caused by some unknown race condition. |
@sushuying521 Do you have subscription to |
@sushuying521 Also, are you using any
In that case, #14599 might fix it. |
@ebariche @jeromelaban I think this should be fixed and can be closed? |
Yes it is! |
Current behavior
Hello, our project uses the c# language to develop the Uno framework + Gtk + Skia running on the Linux platform project,
and it is always triggered occasionally when InitializeComponent() is executed
Expected behavior
No response
How to reproduce it (as minimally and precisely as possible)
No response
Workaround
No response
Works on UWP/WinUI
None
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
NuGet package version(s)
",
Affected platforms
Skia (GTK on Linux/macOS/Windows)
IDE
Visual Studio 2022
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: