OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.23k stars 2.34k forks source link

.net8+orchardcore blazorserver mode render component error #16363

Open justlucky opened 1 week ago

justlucky commented 1 week ago

Describe the bug .net8+orchardcore create webpage, use blazorserver mode @(await Html.RenderComponentAsync(RenderMode.ServerPrerendered)) error.

error content: 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.

To Reproduce Steps to reproduce the behavior:

Create a OrchardCore app, add module, and add WebPage page. Create blazorclasslibrary project, add default Component. call Html.RenderComponentAsync in webpage. browser webpage. Expected behavior 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.

Screenshots

301008515-3e38534d-55d4-4a24-954a-7b37c0305abe

301008533-b01c7b95-c949-4f94-b71b-1da7f72974ba

reference bug #15211

justlucky commented 1 week ago

This bug has been discussed before, but it has not been merged into the main branch yet.

OrchardCore.Demo.zip

enable module; open /Hello

sebastienros commented 1 week ago

This bug has been discussed before, but it has not been merged into the main branch yet.

Can you link to the issue that you mention?

justlucky commented 1 week ago

I won't solve this problem, it's a bit difficult for me, but it has been discussed before; I can only provide a method of reproduction, as I uploaded the module code for OrchardCore above; You can also take a look at the previous discussion records.

reference bug https://github.com/OrchardCMS/OrchardCore/issues/15211

@sebastienros