Replies: 1 comment
-
This error is not specific to our components and relates to a dependency injection lifecycle + Blazor server lifecycle. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
HxGrid throws this exception when page is reloaded.
System.AggregateException: One or more errors occurred. (Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'ApplicationDbContext'.) ---> System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'ApplicationDbContext'. at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed() at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices() at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider() at Microsoft.EntityFrameworkCore.DbContext.get_ChangeTracker() at Microsoft.EntityFrameworkCore.Query.CompiledQueryCacheKeyGenerator.GenerateCacheKeyCore(Expression query, Boolean async) at Microsoft.EntityFrameworkCore.Query.RelationalCompiledQueryCacheKeyGenerator.GenerateCacheKeyCore(Expression query, Boolean async) at Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerCompiledQueryCacheKeyGenerator.GenerateCacheKey(Expression query, Boolean async) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable
1.GetAsyncEnumerator(CancellationToken cancellationToken)at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable
1.GetAsyncEnumerator() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable
1 source, CancellationToken cancellationToken)at LastTexts.GetGridData(GridDataProviderRequest
1 request) in LastTexts.razor:line 51 at Havit.Blazor.Components.Web.Bootstrap.HxGrid
1.InvokeDataProviderInternal(GridDataProviderRequest1 request) at Havit.Blazor.Components.Web.Bootstrap.HxGrid
1.RefreshPaginationOrLoadMoreDataCoreAsync(Boolean forceReloadAllPaginationOrLoadMoreData)at Havit.Blazor.Components.Web.Bootstrap.HxGrid
1.RefreshDataCoreAsync() at Havit.Blazor.Components.Web.Bootstrap.HxGrid
1.OnAfterRenderAsync(Boolean firstRender)`Thank you for investigation.
Beta Was this translation helpful? Give feedback.
All reactions