-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASP .NET Core Blazor app does not work ServerPrerendered
#593
Comments
ServerPrerendered
ServerPrerendered
Today I had some time to dig around in Castle Windsor and found, that during the final render the scope is already disposed, from where Blazorize components are tried to be created, though the Service Provider is still alive. That's because Blazorize ComponentActivator is registered as Singleton, while Castle Windsor registers a ScopedServiceProvider as Scoped. If I match them, it works (no matter, whether both singleton or both scoped). Why is there only a ScopedServiceProvider in Castle Windsor? Maybe @ltines or @jonorossi? |
@astuy Unfortunately no one is maintaining the .NET DependencyInjection support in Castle Windsor. I don't have in depth knowledge of how or why it works/doesn't work. It looks like it is built against 3.1.3 which likely predates most recent Blazor work. There are a few other open issues that people have run into problems (e.g. a InvalidOperationException) with this integration library as it is probably now outdated, or only supported a narrow use case for ASP.NET Core and just has bugs. Personally I won't be contributing time to improving it as I don't use it, however as usual I can code review, merge and make releases, but someone that wants this needs to contribute the work. |
There are multiple instances of Service Provider - per scope. There is also one for the "root scope". How are you accessing it in your project? I am not that familiar with Blazorise though |
The Service Provider is used by ComponentActivator (see https://github.com/Megabit/Blazorise/blob/master/Source/Blazorise/ComponentActivator.cs and https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-5-preview-8/#control-blazor-component-instantiation. Unfortunately this is all of component activator documentation, that I'm aware of. Is that, what you wanted to know? |
Hi all,
I am using Blazorise for a Blazor Server project. They currently updated to .NET 5.0 in order to use
IComponentActivator
for creating IComponents through DI and since then I get anObjectDisposedException
on page load. Setting render mode toServer
works around the bug, but then my site takes hours to be presented to the user.See also my Blazorise Issue.
Do you have an idea?
The text was updated successfully, but these errors were encountered: