Open Closed

The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state #5164


User avatar
0
mithun created

We are currently merging code from ABP non commercial version blazor webassembly solution to ABP commercial version blazor server side solution and facing issues with post api methods where we are using "StateHasChanged();"

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

We tried below microsoft solution but didnt work _ = InvokeAsync(() => { currentCount++; StateHasChanged(); }); https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering?view=aspnetcore-7.0

ABP Framework version: v7.2.2 UI type: Blazor Server Side DB provider: EF Core Tiered (MVC): yes Exception message: Browser console Exception: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state


1 Answer(s)
  • User Avatar
    0
    jfistelmann created

    Hard to tell without taking a look at the code.

    Is this reproducable with the template project? If not, can you send your example to kontakt@chrobyte.de ?

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13