After creating a new Blazor WebApp from ABP Suite, problems exist with impersonation from SAAS module. I do not have the same issue if I create a project from the Blazor Server starter template.
Create a new starter project This get generated with references to package version 9.2 (has known issues with this) Update packages to 9.3 via ABP Studio Created a DB migration but it was empty Run
The 'Login with this tenant' is usually missing, but occasionally present itself after deleting site data.
If it does present and allows you to login to the tenant, it throws an exception (see below), refreshing the page will then show the tenant landing page and the normal user and the return icon will be present:
But after a short period (10 seconds or so) the return icon will disappear:
Exception dump: An unhandled exception occurred while processing the request. NullReferenceException: Object reference not set to an instance of an object. Volo.Abp.AspNetCore.Uow.AspNetCoreUnitOfWorkTransactionBehaviourProvider.get_IsTransactional()
Stack Query Cookies Headers Routing NullReferenceException: Object reference not set to an instance of an object. Volo.Abp.AspNetCore.Uow.AspNetCoreUnitOfWorkTransactionBehaviourProvider.get_IsTransactional() Volo.Abp.Uow.UnitOfWorkInterceptor.CreateOptions(IServiceProvider serviceProvider, IAbpMethodInvocation invocation, UnitOfWorkAttribute unitOfWorkAttribute) Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter<TInterceptor>.InterceptAsync<TResult>(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func<IInvocation, IInvocationProceedInfo, Task<TResult>> proceed) Volo.Abp.PermissionManagement.PermissionStore.SetCacheItemsAsync(string providerName, string providerKey, string currentName, PermissionGrantCacheItem currentCacheItem) Volo.Abp.PermissionManagement.PermissionStore.GetCacheItemAsync(string name, string providerName, string providerKey) Volo.Abp.PermissionManagement.PermissionStore.IsGrantedAsync(string name, string providerName, string providerKey) Volo.Abp.Authorization.Permissions.UserPermissionValueProvider.CheckAsync(PermissionValueCheckContext context) Volo.Abp.Authorization.Permissions.PermissionChecker.IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string name) Volo.Abp.Authorization.PermissionRequirementHandler.HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement) Microsoft.AspNetCore.Authorization.AuthorizationHandler<TRequirement>.HandleAsync(AuthorizationHandlerContext context) Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements) Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, object resource, string policyName) Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.AuthorizeAsync(IAuthorizationService authorizationService, object resource, string policyName) Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.AuthorizeAsync(IAuthorizationService authorizationService, string policyName) Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.IsGrantedAsync(IAuthorizationService authorizationService, string policyName) Volo.Abp.Account.Pro.Admin.Blazor.Settings.AbpAccountAdminSettingManagementComponentContributor.CheckPermissionsInternalAsync(SettingComponentCreationContext context) Volo.Abp.Account.Pro.Admin.Blazor.Settings.AbpAccountAdminSettingManagementComponentContributor.CheckPermissionsAsync(SettingComponentCreationContext context) Volo.Abp.SettingManagement.Blazor.Menus.SettingManagementMenuContributor.CheckAnyOfPagePermissionsGranted(SettingManagementComponentOptions settingManagementComponentOptions, SettingComponentCreationContext settingComponentCreationContext) Volo.Abp.SettingManagement.Blazor.Menus.SettingManagementMenuContributor.ConfigureMainMenuAsync(MenuConfigurationContext context) Volo.Abp.SettingManagement.Blazor.Menus.SettingManagementMenuContributor.ConfigureMenuAsync(MenuConfigurationContext context) Volo.Abp.UI.Navigation.MenuManager.GetInternalAsync(string name) Volo.Abp.UI.Navigation.MenuManager.GetAsync(string[] menuNames) Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Navigation.MainMenuProvider.GetMenuAsync() Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.SideMenu.Navigation.MainMenu.OnInitializedAsync() Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.<WaitForNonStreamingPendingTasks>g__Execute|43_0() Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.WaitForResultReady(bool waitForQuiescence, PrerenderedComponentHtmlContent result) Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.RenderEndpointComponent(HttpContext httpContext, Type rootComponentType, ParameterView parameters, bool waitForQuiescence) System.Runtime.CompilerServices.ValueTaskAwaiter<TResult>.GetResult() Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context) Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context) Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext+<>c+<<InvokeAsync>b__10_0>d.MoveNext() Microsoft.AspNetCore.Builder.ServerRazorComponentsEndpointConventionBuilderExtensions+<>c__DisplayClass1_1+<<AddInteractiveServerRenderMode>b__1>d.MoveNext() Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger) Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Security.Claims.AbpDynamicClaimsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Builder.ApplicationBuilderAbpOpenIddictMiddlewareExtension+<>c__DisplayClass0_0+<<UseAbpOpenIddictValidation>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Solution Config:
- Template: app
- Created ABP Studio Version: 1.2.2
- Current ABP Studio Version: 1.2.2
- Tiered: No
- Multi-Tenancy: Yes
- UI Framework: blazor-webapp
- Theme: leptonx
- Theme Style: system
- Theme Menu Placement: side
- Run Install Libs: Yes
- Database Provider: ef
- Database Management System: sqlserver
- Separate Tenant Schema: No
- Create Initial Migration: Yes
- Run Db Migrator: Yes
- Mobile Framework: none
- Public Website: Yes
- Social Login: No
- Include Tests: Yes
- Kubernetes Configuration: No
- Distributed Event Bus: none
- Use Local References: No
- Optional Modules:
- GDPR
- FileManagement
- TextTemplateManagement
- LanguageManagement
- AuditLogging
- OpenIddictAdmin
- Selected Languages: English (United Kingdom)
- Default Language: English (United Kingdom)
- Create Command: abp new TestBlazorWebApp -t app --ui-framework blazor-webapp --database-provider ef --database-management-system sqlserver --theme leptonx --public-website --without-cms-kit --dont-run-bundling --no-social-logins -file-management
2 Answer(s)
-
0
The impersonation ("Login with this tenant") and return icon issues in ABP Blazor WebApp (v9.3, LeptonX, non-tiered, multi-tenancy) are known and have been reported by other users. The problems include:
- The impersonation menu option is inconsistently visible.
- When impersonation works, a NullReferenceException is thrown (see stack trace), but after a refresh, the impersonation session appears to work temporarily.
- The "return" icon for ending impersonation disappears after a short time.
These issues are not present in Blazor Server starter templates, only in Blazor WebApp projects generated by ABP Suite.
The root cause is related to the ABP Unit of Work and transaction behavior in the Blazor WebApp template, especially after package upgrades (9.2 → 9.3). The impersonation state is not reliably maintained, and the UI does not always reflect the correct session.
Recommended Actions:
- Ensure all ABP and module packages are updated to the latest compatible versions (including LeptonX and SaaS modules).
- Clean and rebuild the solution after upgrading packages.
- If the problem persists, this is a framework-level issue. You should report it (if not already) or follow the official support thread for updates:
Workaround:
- As a temporary measure, use the Blazor Server template if impersonation is critical for your workflow, as it does not exhibit these issues.
Sources:
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.
-
0
All packages were updated, solution cleaned and rebuilt, problem persists.