Blazor Component Inside Orchard Core Module

25 Views Asked by At

I am trying to get a simple Blazor component to run inside an Orchard Module. I have a basic test ASP.NET MVC Site and can easily get the Blazor component to run there. When I compare that app to my Orchard Core app, the only main difference I see is that Orchard has created new RenderPartialAsync and it seems to behave differently from regular ASP.NET Core MVC - I suspect due to the OC team having to take over for shape rendering.

Anyone know how to make this work? The error I am getting is this: An unhandled exception has occurred while executing the request. 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.

Seems to be the way orchard core modules are threaded but I don't fully understand the guts of what is going on there.

I have also posted on the OC Discussions page here: https://github.com/OrchardCMS/OrchardCore/discussions/14951

I am not sure if this is Orchard related or something I am doing incorrectly in general - though I know I can make it work outside of Orchard.

Note: If I drop the component tag inside of my Orchard theme Layout.cshtml (outside of any RenderSection) then it works fine there - so I am pretty sure my overall configuration is correct in Start.cs.

TIA,

0

There are 0 best solutions below