Activities of "327992883@qq.com"

  • ABP Framework version: v7.2.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server,) /
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:
  • This is my code. When I use await _hubContext.Clients.Users(stringUserIds).SendAsync(message.MessageType.ToString(), message); No messages received in blazor page
public async Task SendToUsersAsync<T>(T message) where T : SigalRMessage
 {
     try
     {
         if (!message.UserIds.HasItems())
             return;

         var stringUserIds = message.UserIds.Where(s => !s.IsNullOrEmpty()).Select(x => x.Value.ToString()).ToList();
         await _hubContext.Clients.Users(stringUserIds).SendAsync(message.MessageType.ToString(), message);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "error");
     }
 }
protected override async Task OnInitializedAsync()
{
    SetTableOption();

    var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
    var user = authState.User;
    var claims = CurrentUser.GetAllClaims();
    var headers = new Dictionary<string, string>();
    foreach (var claim in claims)
    {
        if (!headers.Keys.Contains(claim.Type))
            headers.Add(claim.Type, claim.Value);
    }

    _userToken = user.FindFirstValue("access_token"); 

    var signalRUrl = "wss://localhost:44320".EnsureEndsWith('/') + Configuration["HubUrl"].TrimStart('/');

    HubConnection = new HubConnectionBuilder()
        .WithUrl(signalRUrl, options =>
        {
            options.Headers = headers;
            options.AccessTokenProvider = () => Task.FromResult(_userToken);
        }).WithAutomaticReconnect().Build();

    // 2. 定义客户端方法以接收服务器消息
    HubConnection.On<SigalRMessage<Dictionary<string, string>>>(SigalRMessageTypeEnum.OrderSyncSuccess.ToString(), async message =>
    {
        await JSRuntime.InvokeVoidAsync("console.log", $"收到sigalr消息:{message.ToJson()} {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
        StateHasChanged(); 
    });

    await HubConnection.StartAsync();
}

I looked at some sample code

 [Inject]
    protected IAbpAccessTokenProvider AccessTokenProvider { get; set; }

    [Inject]
    protected IOptions<ChatBlazorMauiBlazorOptions> ChatBlazorMauiBlazorOptions { get; set; }

    [Inject]
    protected IOptions<AbpRemoteServiceOptions> AbpRemoteServiceOptions { get; set; }

    protected async override Task SetChatHubConnectionAsync()
    {
        var accessToken = await AccessTokenProvider.GetTokenAsync();

        var signalrUrl = ChatBlazorMauiBlazorOptions.Value.SignalrUrl ?? AbpRemoteServiceOptions.Value.RemoteServices.Default.BaseUrl;

        HubConnection = new HubConnectionBuilder()
            .WithUrl(signalrUrl.EnsureEndsWith('/') + "signalr-hubs/chat", options =>
            {
                options.AccessTokenProvider = () => Task.FromResult(accessToken);
            })
            .Build();
    }

But IAbpAccessTokenProvider does not seem to exist in abp7.2.3 version

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:

  • ABP Framework version: v7.2.3
    • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:API Unauthorized 401 Redirection Error,My goal is not to redirect, just return to the normal HTTP state,I added the request header X-Requested With: XMLHttpRequest, which works normally during local debugging, but when deployed to the server using nginx reverse proxy, it has no effect. Still redirect the login page.
  • ABP Framework version: v7.2.3

  • UI Type: Blazor Server

  • Database System: EF Core (SQL Server)

  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

  • Exception message and full stack trace:2024-02-05 16:25:32.378 +08:00 [ERR] Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.IdentityUserClientProxy.GetAssignableRolesAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.UserManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.378 +08:00 [ERR] 执行异常处理逻辑,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.378 +08:00 [ERR] 执行异常处理401过期,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.378 +08:00 [WRN] Unhandled exception rendering component: Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.IdentityUserClientProxy.GetAssignableRolesAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.UserManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.378 +08:00 [ERR] Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.OrganizationUnitClientProxy.GetListAllAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.GetOrganizationUnitsAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.379 +08:00 [ERR] 执行异常处理逻辑,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.379 +08:00 [ERR] 执行异常处理401过期,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.379 +08:00 [WRN] Unhandled exception rendering component: Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.OrganizationUnitClientProxy.GetListAllAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.GetOrganizationUnitsAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.380 +08:00 [ERR] Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.IdentityUserClientProxy.GetExternalLoginProvidersAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.Components.IdentityUserImportDropdownComponent.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.380 +08:00 [ERR] 执行异常处理逻辑,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.380 +08:00 [ERR] 执行异常处理401过期,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.380 +08:00 [WRN] Unhandled exception rendering component: Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.IdentityUserClientProxy.GetExternalLoginProvidersAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.Components.IdentityUserImportDropdownComponent.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.380 +08:00 [INF] Received HTTP response headers after 64.4974ms - 401 2024-02-05 16:25:32.380 +08:00 [INF] End processing HTTP request after 64.705ms - 401 2024-02-05 16:25:32.380 +08:00 [ERR] Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Saas.Host.ClientProxies.EditionClientProxy.GetListAsync(GetEditionsInput input) at Volo.Saas.Host.Blazor.Pages.Saas.Host.TenantManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.380 +08:00 [ERR] 执行异常处理逻辑,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.380 +08:00 [ERR] 执行异常处理401过期,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.380 +08:00 [WRN] Unhandled exception rendering component: Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Saas.Host.ClientProxies.EditionClientProxy.GetListAsync(GetEditionsInput input) at Volo.Saas.Host.Blazor.Pages.Saas.Host.TenantManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.381 +08:00 [ERR] Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.OrganizationUnitClientProxy.GetListAllAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.GetOrganizationUnitsAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.381 +08:00 [ERR] 执行异常处理逻辑,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.381 +08:00 [ERR] 执行异常处理401过期,HttpStatusCode--401,Message--Unauthorized 2024-02-05 16:25:32.381 +08:00 [WRN] Unhandled exception rendering component: Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.OrganizationUnitClientProxy.GetListAllAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.GetOrganizationUnitsAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.OrganizationUnitsManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.382 +08:00 [ERR] Unauthorized Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.IdentityUserClientProxy.GetAssignableRolesAsync() at Volo.Abp.Identity.Pro.Blazor.Pages.Identity.UserManagement.OnInitializedAsync() at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) 2024-02-05 16:25:32.382 +08:00 [ERR] 执行异常处理逻辑,HttpStatusCode--401,Message--Unauthorized

  • Steps to reproduce the issue:After staying on the page for a few hours, click the query button of the page again. The status is 401 but it will not jump to the login page. The page will keep flashing. AbpComponentsBase is not used, but a custom base class, in which the exception handling code:

  • ` protected override async Task OnErrorAsync(Exception exception) { if (IsDisposed) return;

           Logger.LogError(new EventId(0, "Global Exception"), exception: exception, message: exception.Message);
           if (exception is AbpRemoteCallException)
           {
               var ex = exception as AbpRemoteCallException;
               Logger.LogError($"Execute exception handling logic, HttpStatusCode--{ex.HttpStatusCode},Message--{ex.Message}");
    
               //401 error returns to the original exception handling mechanism and allows the front desk to jump
               if (ex.HttpStatusCode == (int)HttpStatusCode.Unauthorized)
               {
                   Logger.LogError($"Execution exception handling 401 expired, HttpStatusCode--{ex.HttpStatusCode},Message--{ex.Message}");
                   await base.OnErrorAsync(exception);
                   return;
               }
    
               await UiMessageService.Info(ex.Error.Message, ex.Error.Code);
               return;
           }
    
           //await base.OnErrorAsync(exception);
           if (exception is UserFriendlyException)
           {
               var ex = exception as UserFriendlyException;
               await UiMessageService.Info(ex.Message);
               return;
           }
    
           if (exception is BusinessException)
           {
               var ex = exception as BusinessException;
               await UiMessageService.Warn(ex.Message, ex.Code);
               return;
           }
           await UiMessageService.Error(exception.Message);
       }`
    
  • ABP Framework version: v7.2.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server) /
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue: Currently, I have two modules (Product Module and Order Module) developed in a modular fashion using NuGet dependencies. The Contracts in the Order Module depend on the Contracts in the Product Module. Now, I need to implement a feature in the Product Module to query the quantity of products in transit in the product inventory table. This requires calculating the quantity of products in ongoing orders in the Order Module. I'm considering using local events to achieve this, where changes in products in orders trigger updates in the quantity of products in transit in the Product Module. However, it's not advisable for the domain of the Order Module to depend on the domain of the Product Module, is it? Can you provide some advice or suggest a better approach? Thank you.

ABP Framework version: v7.2.3

UI Type: Blazor Server

Database System: EF Core

Tiered (for MVC) or Auth Server Separated (for Angular): yes

Exception message and full stack trace:

Steps to reproduce the issue: seems to be related to resource release.

Hello I am using LeptonXTheme UI. I want to be able to see which pages have been opened like the picture above. Display all open tabs at the top and click on the tab above to achieve the effect of switching pages. This is what I have here. A usage habit, does LeptonXTheme UI support this function? In addition, every time I open the page and return to the previous page, the page status will not be retained. Is it possible to maintain the page status like vue keep-alive or do A short-lived storage; now I cannot use LeptonXTheme UI to achieve the above functions. Can you give me some methods or suggestions to achieve these functions?

  • ABP Framework version: v7.2.3
  • UI Type: Blazor Server
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • [18:21:45 DBG] Found in the cache: pn:U,pk:91a14806-b5c0-aa82-b0cb-3a0c6095438a,n:Inventories.OutboundOrder.Create [18:21:45 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Inventories.OutboundOrder.Create [18:21:45 DBG] Found in the cache: pn:U,pk:91a14806-b5c0-aa82-b0cb-3a0c6095438a,n:Inventories.OutboundOrderDetail [18:21:45 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Inventories.OutboundOrderDetail [18:21:45 DBG] Found in the cache: pn:R,pk:admin,n:Inventories.OutboundOrder.Create [18:21:45 DBG] Found in the cache: pn:R,pk:admin,n:Inventories.OutboundOrderDetail [18:21:47 WRN] Unhandled exception rendering component: Cannot access a disposed object. Object name: 'Loda.Abp.StoreManage.Inventories.Blazor.Pages.Inventories.OutboundOrder'. System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Loda.Abp.StoreManage.Inventories.Blazor.Pages.Inventories.OutboundOrder'. at Loda.Abp.Components.LodaComponentBase.get_ScopedServices() at Loda.Abp.Components.LodaComponentBase.LazyGetRequiredService[TRef](Type serviceType, TRef& reference) at Loda.Abp.Components.LodaComponentBase.LazyGetRequiredService[TService](TService& reference) at Loda.Abp.Components.LodaComponentBase.get_LoggerFactory() at Loda.Abp.Components.LodaComponentBase.<get__lazyLogger>b__37_0() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at Loda.Abp.Components.LodaComponentBase.get_Logger() at Loda.Abp.Components.LodaComponentBase.OnErrorAsync(Exception exception) at Microsoft.AspNetCore.Components.ErrorBoundaryBase.Microsoft.AspNetCore.Components.IErrorBoundary.HandleException(Exception exception) at Microsoft.AspNetCore.Components.RenderTree.Renderer.HandleExceptionViaErrorBoundary(Exception error, ComponentState errorSourceOrNull) [18:21:47 ERR] Unhandled exception in circuit 'LIOY43OPH3utkSu22ZegyguiJKfC3kmBReCuWQ8lhY8'. System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Loda.Abp.StoreManage.Inventories.Blazor.Pages.Inventories.OutboundOrder'. at Loda.Abp.Components.LodaComponentBase.get_ScopedServices() at Loda.Abp.Components.LodaComponentBase.LazyGetRequiredService[TRef](Type serviceType, TRef& reference) at Loda.Abp.Components.LodaComponentBase.LazyGetRequiredService[TService](TService& reference) at Loda.Abp.Components.LodaComponentBase.get_LoggerFactory() at Loda.Abp.Components.LodaComponentBase.<get__lazyLogger>b__37_0() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at Loda.Abp.Components.LodaComponentBase.get_Logger() at Loda.Abp.Components.LodaComponentBase.OnErrorAsync(Exception exception) at Microsoft.AspNetCore.Components.ErrorBoundaryBase.Microsoft.AspNetCore.Components.IErrorBoundary.HandleException(Exception exception) at Microsoft.AspNetCore.Components.RenderTree.Renderer.HandleExceptionViaErrorBoundary(Exception error, ComponentState errorSourceOrNull) [18:21:47 INF] Executed endpoint '/_blazor' [18:21:47 INF] Request finished HTTP/2 CONNECT https://localhost:44354/_blazor?id=XaSAouEAb9hvCj8WlD56sA - - - 200 - - 5496.7929ms [18:21:47 INF] Connection id "0HMVLFE759C7D", Request id "0HMVLFE759C7D:0000003B": the application completed without reading the entire request body.
  • Steps to reproduce the issue: My blazor server will throw an exception when jumping from one page to another, but refreshing any of the pages directly will not cause an exception. The exception is only when jumping, and it seems to be related to resource release.

LodaComponentBase.cs,This is the base class for all our component pages

using Blazorise.Localization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Net;
using Volo.Abp;
using Volo.Abp.AspNetCore.Components.Alerts;
using Volo.Abp.AspNetCore.Components.ExceptionHandling;
using Volo.Abp.AspNetCore.Components.Messages;
using Volo.Abp.AspNetCore.Components.Notifications;
using Volo.Abp.Http.Client;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Timing;
using Volo.Abp.Users;

namespace Loda.Abp.Components
{
    public class LodaComponentBase : ErrorBoundary, IDisposable
    {
        [Inject] public IUiMessageService UiMessageService { get; set; }
        [Inject]
        public Blazorise.Localization.ITextLocalizerService LocalizationService { get; set; }

        public LodaComponentBase()
        {

        }
        protected override Task OnInitializedAsync()
        {
            var IetfLanguageTag = CultureInfo.CurrentCulture.IetfLanguageTag;
            if (IetfLanguageTag.Split("-").Length > 1)
            {
                var split = IetfLanguageTag.Split("-")[0];
                LocalizationService.ChangeLanguage(split);
            }
            return base.OnInitializedAsync();
        }


        protected override Task OnErrorAsync(Exception exception)
        {
            
            Logger.LogError(new EventId(0, "全局异常"), exception: exception, message: exception.Message);
            if (exception is AbpRemoteCallException)
            {
                var ex = exception as AbpRemoteCallException;

                //401错误返回原来的异常处理机制,让前台做跳转
                if (ex.HttpStatusCode == (int)HttpStatusCode.Unauthorized) return base.OnErrorAsync(exception);

                return UiMessageService.Info(ex.Error.Message, ex.Error.Code);
            }

            //await base.OnErrorAsync(exception);             
            if (exception is UserFriendlyException)
            {
                var ex = exception as UserFriendlyException;
                return UiMessageService.Info(ex.Message);
            }

            if (exception is BusinessException)
            {
                var ex = exception as BusinessException;
                return UiMessageService.Warn(ex.Message, ex.Code);
            }
            return UiMessageService.Error(exception.Message);
        }

        //OwningComponentBase 基类部分

        private AsyncServiceScope? _scope;

        [Inject] IServiceScopeFactory ScopeFactory { get; set; } = default!;

        protected bool IsDisposed { get; private set; }

        protected IServiceProvider ScopedServices
        {
            get
            {
                if (ScopeFactory == null)
                {
                    throw new InvalidOperationException("Services cannot be accessed before the component is initialized.");
                }

                ObjectDisposedException.ThrowIf(IsDisposed, this);

                _scope ??= ScopeFactory.CreateAsyncScope();
                return _scope.Value.ServiceProvider;
            }
        }

        void IDisposable.Dispose()
        {
            if (!IsDisposed)
            {
                _scope?.Dispose();
                _scope = null;
                Dispose(disposing: true);
                IsDisposed = true;
            }
        }

        /// <inheritdoc />
        protected virtual void Dispose(bool disposing)
        {
        }

        //---------------------------------------------

        //AbpComponentBase基类部分
        protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory);
        private IStringLocalizerFactory _stringLocalizerFactory;

        protected IStringLocalizer L
        {
            get
            {
                if (_localizer == null)
                {
                    _localizer = CreateLocalizer();
                }

                return _localizer;
            }
        }
        private IStringLocalizer _localizer;

        protected Type LocalizationResource
        {
            get => _localizationResource;
            set
            {
                _localizationResource = value;
                _localizer = null;
            }
        }
        private Type _localizationResource = typeof(DefaultResource);

        protected ILogger Logger => _lazyLogger.Value;
        private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);

        protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory);
        private ILoggerFactory _loggerFactory;

        protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService);
        private IAuthorizationService _authorizationService;

        protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser);
        private ICurrentUser _currentUser;

        protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant);
        private ICurrentTenant _currentTenant;

        protected IUiMessageService Message => LazyGetNonScopedRequiredService(ref _message);
        private IUiMessageService _message;

        protected IUiNotificationService Notify => LazyGetNonScopedRequiredService(ref _notify);
        private IUiNotificationService _notify;

        protected IUserExceptionInformer UserExceptionInformer => LazyGetNonScopedRequiredService(ref _userExceptionInformer);
        private IUserExceptionInformer _userExceptionInformer;

        protected IAlertManager AlertManager => LazyGetNonScopedRequiredService(ref _alertManager);
        private IAlertManager _alertManager;

        protected IClock Clock => LazyGetNonScopedRequiredService(ref _clock);
        private IClock _clock;

        protected AlertList Alerts => AlertManager.Alerts;

        protected IObjectMapper ObjectMapper
        {
            get
            {
                if (_objectMapper != null)
                {
                    return _objectMapper;
                }

                if (ObjectMapperContext == null)
                {
                    return LazyGetRequiredService(ref _objectMapper);
                }

                return LazyGetRequiredService(
                    typeof(IObjectMapper<>).MakeGenericType(ObjectMapperContext),
                    ref _objectMapper
                );
            }
        }

        private IObjectMapper _objectMapper;

        protected Type ObjectMapperContext { get; set; }

        protected TService LazyGetRequiredService<TService>(ref TService reference) => LazyGetRequiredService(typeof(TService), ref reference);

        protected TRef LazyGetRequiredService<TRef>(Type serviceType, ref TRef reference)
        {
            if (reference == null)
            {
                reference = (TRef)ScopedServices.GetRequiredService(serviceType);
            }

            return reference;
        }

        protected TService LazyGetService<TService>(ref TService reference) => LazyGetService(typeof(TService), ref reference);

        protected TRef LazyGetService<TRef>(Type serviceType, ref TRef reference)
        {
            if (reference == null)
            {
                reference = (TRef)ScopedServices.GetService(serviceType);
            }

            return reference;
        }

        protected TService LazyGetNonScopedRequiredService<TService>(ref TService reference) => LazyGetNonScopedRequiredService(typeof(TService), ref reference);

        protected TRef LazyGetNonScopedRequiredService<TRef>(Type serviceType, ref TRef reference)
        {
            if (reference == null)
            {
                reference = (TRef)NonScopedServices.GetRequiredService(serviceType);
            }

            return reference;
        }

        protected TService LazyGetNonScopedService<TService>(ref TService reference) => LazyGetNonScopedService(typeof(TService), ref reference);

        protected TRef LazyGetNonScopedService<TRef>(Type serviceType, ref TRef reference)
        {
            if (reference == null)
            {
                reference = (TRef)NonScopedServices.GetService(serviceType);
            }

            return reference;
        }

        [Inject]
        protected IServiceProvider NonScopedServices { get; set; }

        protected virtual IStringLocalizer CreateLocalizer()
        {
            if (LocalizationResource != null)
            {
                return StringLocalizerFactory.Create(LocalizationResource);
            }

            var localizer = StringLocalizerFactory.CreateDefaultOrNull();
            if (localizer == null)
            {
                throw new AbpException($"Set {nameof(LocalizationResource)} or define the default localization resource type (by configuring the {nameof(AbpLocalizationOptions)}.{nameof(AbpLocalizationOptions.DefaultResourceType)}) to be able to use the {nameof(L)} object!");
            }

            return localizer;
        }

        protected virtual async Task HandleErrorAsync(Exception exception)
        {
            Logger.LogException(exception);
            await InvokeAsync(async () =>
            {
                await UserExceptionInformer.InformAsync(new UserExceptionInformerContext(exception));
                StateHasChanged();
            });
        }
    }
}

After the blazer server is deployed through nginx, when requesting the auth service redirect _uri is http instead of https, and through the logs of the auth service redirect _uri is also http, this redirect_uri How does need to be configured to obtain https?

  • ABP Framework version: vX.X.X
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

How to customize the login page if it is Blazor?Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:

  • ABP Framework version: v7.2.3
  • UI Type:Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

在提问之前先查看文档:https://docs.abp.io/en/commercial/latest/ 检查样本以查看基本任务:https://docs.abp.io/en/commercial/latest/samples/index 您的问题的解决方案之前可能已经有答案,请先使用首页搜索。 向我们提供以下信息:

  • ABP Framework version: v7.2.3
  • UI Type: / Blazor Server
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • 异常消息和完整堆栈跟踪:None
  • 重置问题的步骤: I used the LeptonX Theme and then used the NumericEdit component. It does not limit the input type. This is different from the NumericEdit used on the blazorise official website. Using TValue in the blazorise official website document can limit the input type. I set TValue=int, but decimals can still be input. my code @page "/" <NumericEdit TValue="int"></NumericEdit> this is result

Provide us with the following info:After project deployment, use auth authorization to redirect to the blazer homepage and prompt for "Internal Server Error"

  • ABP Framework version: v7.2.3
  • UI Type: / Blazor Server
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • AbpRemoteCallException: Internal Server Error Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.ThrowExceptionForResponseAsync(HttpResponseMessage response) Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.RequestAsync(ClientProxyRequestContext requestContext) Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.RequestAsync<T>(ClientProxyRequestContext requestContext) Volo.Abp.Http.Client.ClientProxying.ClientProxyBase<TService>.RequestAsync<T>(string methodName, ClientProxyRequestTypeValue arguments) Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies.AbpApplicationConfigurationClientProxy.GetAsync(ApplicationConfigurationRequestOptions options) Volo.Abp.AspNetCore.Mvc.Client.MvcCachedApplicationConfigurationClient.GetRemoteConfigurationAsync() Volo.Abp.AspNetCore.Mvc.Client.MvcCachedApplicationConfigurationClient.<GetAsync>b__19_0() Volo.Abp.Caching.DistributedCache<TCacheItem, TCacheKey>.GetOrAddAsync(TCacheKey key, Func<Task<TCacheItem>> factory, Func<DistributedCacheEntryOptions> optionsFactory, Nullable<bool> hideErrors, bool considerUow, CancellationToken token) Volo.Abp.AspNetCore.Mvc.Client.MvcCachedApplicationConfigurationClient.GetAsync() Volo.Abp.AspNetCore.Mvc.Client.RemoteSettingProvider.GetOrNullAsync(string name) Volo.Abp.AspNetCore.Components.Server.LeptonTheme.Bundling.BlazorLeptonThemeStyleContributor.JgxciT56ZV(BundleConfigurationContext ) Volo.Abp.AspNetCore.Components.Server.LeptonTheme.Bundling.BlazorLeptonThemeStyleContributor.ConfigureBundleAsync(BundleConfigurationContext context) Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.GetBundleFilesAsync(List<IBundleContributor> contributors) Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.GetBundleFilesAsync(BundleConfigurationCollection bundles, string bundleName, IBundler bundler) Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.GetStyleBundleFilesAsync(string bundleName) Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperStyleService.GetBundleFilesAsync(string bundleName) Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, List<BundleTagHelperItem> bundleItems, string bundleName) Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpBundleTagHelperService<TTagHelper, TService>.ProcessAsync(TagHelperContext context, TagHelperOutput output) Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, int i, int count) Loda.Abp.StoreManage.Blazor.Pages.Pages__Host.<ExecuteAsync>b__16_0() in _Host.cshtml
  • <abp-style-bundle name="@BlazorLeptonThemeBundles.Styles.Global" /> Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() Loda.Abp.StoreManage.Blazor.Pages.Pages__Host.ExecuteAsync() in _Host.cshtml

<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl"> Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>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.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

  • Steps to reproduce the issue:
Showing 1 to 10 of 10 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11