Error: System.InvalidOperationException: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state

ykl
ykl
340 Points
17 Posts

How to fix following error?

Error: System.InvalidOperationException: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state.
   at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
Views: 376
Total Answered: 1
Total Marked As Answer: 0
Posted On: 24-May-2024 02:26

Share:   fb twitter linkedin
Answers
dev3
dev3
154 Points
3 Posts
         

Try following:

this.InvokeAsync(() => this.StateHasChanged());
Posted On: 24-May-2024 23:06
 Log In to Chat