Activities of "EngincanV"

Hi . The error dialog still showing after editing code like you suggested.

<TelerikSwitch Value="@item.IsActive" 
                                               OnLabel=" " 
                                               OffLabel=" " 
                                               Size="@ThemeConstants.Switch.Size.Small" 
                                               OnChange="@(async () => await ToggleStatus(item))"/> 
                                </span> 
 
private async Task ToggleStatus(ChassisTypeDto item) 
    { 
        try 
        { 
            throw new UserFriendlyException("Test exception"); 
        } 
        catch (UserFriendlyException ex) 
        { 
            Logger.LogError(ex, "Handled UserFriendlyException"); 
            await Notify.Error(string.IsNullOrEmpty(ex.Message) ? L["Messages:Error"] : ex.Message); 
        } 
        catch (Exception e) 
        { 
            Logger.LogError(e, "Error change status container type with id id :{SelectedChassisTypeId}", 
                SelectedChassisTypeId); 
 
            await Notify.Error(string.IsNullOrEmpty(e.Message) ? L["Messages:Error"] : e.Message); 
        } 
        finally 
        { 
            LoaderVisible = false; 
        } 
    } 

Okay, it seems it's all about timing and you need to disable ABP's exception handling system on the UI side. To do that, you can add the following line to both your Blazor.Client and Blazor projects' module classes:

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        //other configs...
        context.Services.Replace(ServiceDescriptor.Transient(typeof(IUserExceptionInformer), typeof(NullUserExceptionInformer)));

    }

This will replace the UserExceptionInformer service (https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/UserExceptionInformer.cs), which shows a message dialog by default. If you want you can create your own UserExceptionInformer implementation and then show Notify popup on the bottom-right for each exception.

After the replacement, it should work seamlessly:

Hi, actually, you should have a shared library for your localization files and the related configuration. So, for example, if you move your localization configurations and the related Localization/Resources/Test/*.json to *.Application.Contracts it should work.

In summary, you should have a shared library to make these configurations (because normally, Blazor.Client is a Blazor WASM application at its core), and then you can inject the IStringLocalizer<TestResource> and use it in your blazor application:

1-)

2-) Update the related *.csproj:

  <ItemGroup>
    <EmbeddedResource Include="Localization\Resources\Test\*.json" />
    <Content Remove="Localization\Resources\Test\*.json" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.0" />
  </ItemGroup>
  
  <PropertyGroup>
    <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
  </PropertyGroup>

3-) Then, use it in your page:

But when I send this dto to create method of service, I get an error of this type: System.InvalidOperationException, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e

Hi Murat, API is using the default .NET model binder, and something in your custom attribute is causing a validation metadata exception or reflection issue before the controller is even entered.

There are some checks that you can do:

  • Make sure PspResource is in a shared project. (It typically should be in *.Domain.Shared project)
  • Comment out the constructor of your attribute and debug your application to see if the related 2 lines are the problem:
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter,
    AllowMultiple = false)]
public class PspRequiredAttribute : RequiredAttribute
{
    public PspRequiredAttribute()
    {
        //ErrorMessageResourceName = nameof(PspResource.RequiredAttribute_ValidationError);
        //ErrorMessageResourceType = typeof(PspResource);
    }
}

When your API (the backend part) tries to reflect over the DTO, it's trying to fetch the error message string via the ErrorMessageResourceType during model binding, and probably this where you get error.


After you have tried these two suggestions, please let me know about the situation. If it's not related to reflection problem, then please share your PspResource class and give more details (such as where the resource class is defined, where you created the attribute, and any other context)

Regards.

Hi, thanks for the detailed explanation!

I've followed your suggestion and updated the OnChange handler to use an async lambda as shown:

However, I'm still seeing the default error dialog (from ABP) even though the exception is caught and I’m manually showing a toast notification.

And can i ask are there any supported way to disable this dialog globally or override the error handling mechanism or correctly to handle this?

Thanks again for your support!

<TelerikSwitch Value="@item.IsActive" 
               OnLabel=" " 
               OffLabel=" " 
               Size="@ThemeConstants.Switch.Size.Small" 
               OnChange="@(async () => await ToggleStatus(item))" /> 
 
 
private async Task ToggleStatus(ContainerTypeDto item) 
{ 
    try 
    { 
        var messageKey = item.IsActive ? "Delete:ConfirmInactiveMessage" : "Delete:ConfirmActiveMessage"; 
        var message = L[messageKey, L["ContainerType"]]; 
 
        if (await Dialogs.ConfirmAsync(message, L["Dialog:ConfirmAction"])) 
        { 
            LoaderVisible = true; 
            SelectedContainerTypeId = item.Id.ToString(); 
            await ContainerTypeService.ChangeStatusAsync(Guid.Parse(SelectedContainerTypeId)); 
 
            var result = await ContainerTypeService.GetListAsync(new ContainerTypeRequestDto()); 
            ContainerTypes = result.Items.ToList(); 
 
            await Notify.Success(L["Messages:Success"]); 
        } 
    } 
    catch (Exception e) 
    { 
        Logger.LogError(e, "Error changing container type status for ID: {SelectedContainerTypeId}", SelectedContainerTypeId); 
        await Notify.Error(string.IsNullOrEmpty(e.Message) ? L["Messages:Error"] : e.Message); 
    } 
    finally 
    { 
        LoaderVisible = false; 
    } 
} 
 
public async Task ChangeStatusAsync(Guid containerTypeId) 
    { 
        var containerType = await repository.GetAsync(containerTypeId); 
 
        var hasInUse = await containerRepository 
            .AnyAsync(d => d.ContainerTypeId == containerTypeId && 
                           !d.IsDeleted && 
                           d.Asset != null && 
                           d.Asset.IsActive); 
 
        if (hasInUse) 
        { 
            throw new BusinessException(TmsSolutionDomainErrorCodes.ContainerTypeIsInUse); 
        } 
 
        containerType.IsActive = !containerType.IsActive; 
        await repository.UpdateAsync(containerType); 
    } 

Hi, you should catch UserFriendlyException, because ABP shows dialog for this exception type. Can you try like in my suggested code?

Is the next patch release date obvious?

We haven't decided on the date, but it will probably be next week.

One more question about latest version:

After update completed when i check the UI's, I realized that all datatables have horizontal scrol now. Is it a bug or what?

Note: There is no css overload for datatables

Yes, this is a known issue and we will fix it with the next patch release.

Hi,

It works now. Thank you.

There are some enconding characters (%20) at the end of the latest-version.json file url.
Is it possible that the latest version information cannot be obtained because of this when performing an ABP update?

Yes, it might be. I'll check that, thanks for pointing that out 👍

Hi, when using the abp update command, normally, the command checks the latest stable version from this file and then updates your project.

So, it's really weird to see that. Can you try to update by specifying the version and see if it works for you:

abp update --version 9.1.1

Hi, it's impossible for us to fix the problem with the shared logs. Actually, we are directly using Hangfire's own dashboard UI and you can check their documentation to understand the reason: https://docs.hangfire.io/en/latest/configuration/using-dashboard.html

Please refer to the related documentation, and if you still can't fix your problem, then we can assist you.

Thanks for sharing the test via email. We got your mail and we will evaluate it.

Showing 231 to 240 of 1355 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20