Hello,
I recently updated my project to 9.3.1. Everything seems to work fine, until I refresh a page, and then it crashes and I get the following error. It happens on every page. Do you know what the issue could be?
Thank you.
[07:55:24 INF] Request starting HTTP/2 POST https://localhost:31753/_blazor/disconnect - multipart/form-data; boundary=----WebKitFormBoundaryHX3a7psAmKrOgsSj 359 Unhandled exception. System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed. at Autofac.Core.Lifetime.LifetimeScope.ThrowDisposedException() at Blazorise.ComponentActivator.CreateInstance(Type componentType) at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, Int32 frameIndex, Int32 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Components.HtmlRendering.Infrastructure.StaticHtmlRenderer.HandleException(Exception exception) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue() at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessPendingRender() at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged() at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<InvokeAsync>g__Execute|8_0(ValueTuple`3 state) --- End of stack trace from previous location --- at Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.Common.Breadcrumbs.IynFghwTvG(Object s, PropertyChangedEventArgs ) at System.Threading.Tasks.Task.<>c.
4 Answer(s)
- 
    0- The error you are encountering (System.ObjectDisposedExceptionrelated to Autofac and Blazorise) after upgrading to ABP 9.3.1 with Blazor Server is typically caused by a mismatch or incompatibility between the Blazorise package versions and the ABP/Blazor project dependencies. This is especially common after major upgrades.
 To resolve this issue, follow these steps: - Update Blazorise Packages 
 Ensure that all Blazorise-related NuGet packages in your solution are updated to the latest versions compatible with .NET 8/9 and ABP 9.x. You can do this via NuGet Package Manager or by editing your- .csprojfiles.
- Clean and Rebuild - Delete the binandobjfolders in all projects.
- Rebuild the solution to clear any cached assemblies.
 
- Delete the 
- Check for Duplicate Registrations - Make sure you are not registering Blazorise services (e.g., AddBootstrap5Providers,AddFontAwesomeIcons) in both your Blazor and Host projects. Shared registrations should be in a shared module or only in the host for Blazor Server.
 
- Make sure you are not registering Blazorise services (e.g., 
- Update ABP and Run Bundle - Run abp updatein your solution root to update all ABP-related packages.
- Run abp bundleto update static assets.
 
- Run 
- Review Dependency Injection Configuration - Ensure that your DI registrations for Blazorise and other UI components are correct and not duplicated or missing.
 
- Restart Development Environment - Sometimes, Visual Studio or your IDE may cache old assemblies. Restart your IDE after the above steps.
 
 If the problem persists, try creating a new ABP Blazor Server solution with the same version and compare the package versions and startup configuration. Sources: - https://abp.io/community/articles/2v8590g3
- https://abp.io/docs/latest/release-info/migration-guides/pro/blazorui-3-3
 
 This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon. 
- The error you are encountering (
- 
    0hi Can you share a minimal project to show the problem? Or you can test with 9.3.x template project. Thanks liming.ma@volosoft.com 
- 
    0Thanks - I discovered the solution was moving the functions previously in OnInitializedAsync() to OnAfterRenderAsync(bool firstRender). 
- 
    0Thanks. 👍 
 
                                