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 ?

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19