Obscure error message when modifying property accessed by UI on timer thread #9984
Labels
area-CoreFramework
Issues on fundamental components like UIElement, visibility, etc.
bug
Something isn't working
team-Markup
Issue for the Markup team
Describe the bug
Normally, when you access anything that the UI concerns from another thread, you have to go through the dispatcher. A member in the UWP Community Discord ran into this same problem, but was met with a very undescriptive error message, saying
System.Runtime.InteropServices.COMException: ""
.Though, I do recall seeing the proper error message before when this happened, but I don't remember how long ago that was.
Steps to reproduce the bug
https://github.com/Pdawg-bytes/WASDK-INPC-COMException-repro/tree/main
Clone this repository and run the app. Take note of the comments in
App1/SystemViewModel.cs
.Expected behavior
When you attempt to access something like this, the error message should tell you that you need to use the Dispatcher to dispatch it to the UI thread.
Screenshots
Here's the undescriptive error message:
NuGet package version
WinUI 3 - Windows App SDK 1.6.0: 1.6.240829007
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
The text was updated successfully, but these errors were encountered: