Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "ITWebTeam"

We are implementing custom exception handling for our project. We've implemented IAsyncEventHandler<AbpHandledExceptionData> for AppServices and IAsyncExceptionFilter for Controllers and everything works fine, these areas are covered.

We also have a lot of IAsyncEventHandler governed by hangfire for different background events. The problem is that if an exception occurs inside HandleEventAsync, neither handler nor filter get triggered.

Is there any way to handle these exceptions?

We have tried following (nothing worked):

  • creating custom ExceptionFilterAttribute and attaching it to the instance of IAsyncExceptionFilter, attribute never gets called.
  • monitoring AbpHandledExceptionData, never gets called.
  • monitoring EntityCreatedEventData<AuditLog> doesn't work because audit log is not written in this case.
  • monitoring EntityCreatedEventData<SqlJob> doesn't work because Hangfire.SqlJob is not public like audit log.
  • using custom logger for hangfire doesn't do anything, the logger never gets called:

Startup:

                services.AddHangfire(config =>
                {
                    config.UseSqlServerStorage(_appConfiguration.GetConnectionString("Default"));
                    config.UseFilter(new AutomaticRetryAttribute 
                    { 
                        Attempts = 2,
                        OnAttemptsExceeded = AttemptsExceededAction.Fail,
                        LogEvents = true,
                    });
                    config.UseLogProvider(new CustomLog4NetLogProvider()); // doesn't work
                });

Custom logger:

    public class CustomLog4NetLogProvider : Log4NetLogProvider
    {
        public new ILog GetLogger(string name)
        {
            return new CustomLog4NetLogger(base.GetLogger(name));
        }
    }
    public class CustomLog4NetLogger : ILog
    {
        private readonly ILog _baseLogger;
        public CustomLog4NetLogger(ILog baseLogger)
        {
            _baseLogger = baseLogger;
        }
        public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception = null)
        {
            // do something
            return _baseLogger.Log(logLevel, messageFunc, exception);
        }
    }
  • AspNetZero v11.1.0
  • MVC
  • .net core

Hi, I am looking to update rows in a table that is Audited but in this specific instance I want to update the data and prevent the LastModifierUserId, LastModificationTime columns from being automatically updated. I also would like to prevent the ABP Entity Change tables from logging the change. Is it possible to turn off auditing as needed on a per method basis?

Thank you

  • What is your product version? 11.1
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .net core

Setting MultiTenancyEnabled = false causes "System.FormatException: 'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.'" error in startup.cs > app.UseAbpRequestLocalization();

It works find if we leave Multi Tenancy Enabled.

Background: We are upgrading our project's from AspNetZero 8.9.2 to 11.1.

Any help is appreciated.

Hi,

My product version is ASP.NET CORE MVC & jQuery .NET Core 3.1 v9.0.0

How would we add an Active Directory Group to an ABP Role and have it grant the appropriate permissions?

Thanks, Ron

Hello,

I feel like it would be invaluable to the community if we could have access to the source code of the Power Tools to customize it to meet our constantly changing needs. I believe the VC RAD tool is already on Github, so it seems like this should be available as well.

Are there any plans to release it in a private repo on Github?

Thanks, Ron

Hello,

I'm attempting to run Power Tools when I have multiple DbContexts (2). I'm receiving the error "More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands."

In my scenario, only one DbContext is writable.

Is it possible to overcome this by telling Power Tools which DbContext to use?

Thank you for your help, Ron

Hello,

I've been watching the Udemy course and came to the demo for the Power tools. When trying to run them I get the error " Specified command or file was not found"

I'm using the latest AspNetZero with Angular, Visual Studio 2019 and SQL Server.

Below is a screen grab of the Console windows. -> PersonsAppService.cs is being generated. -> IPersonsAppService.cs is being generated. -> PersonConsts.cs is being generated. -> CreateOrEditPersonDto.cs is being generated. -> PersonDto.cs is being generated. -> GetAllPersonsForExcelInput.cs is being generated. -> GetAllForLookupTableInput.cs is being generated. -> GetAllPersonsInput.cs is being generated. -> GetPersonForViewDto.cs is being generated. -> GetPersonForEditOutput.cs is being generated. -> Person.cs is being generated. -> PersonsExcelExporter.cs is being generated. -> IPersonsExcelExporter.cs is being generated. -> AppPermissions.cs is being modified. -> AppAuthorizationProvider.cs is being modified. -> EntityHistoryHelper.cs is being modified. -> AspZeroAngularDemoDbContext.cs is being modified. -> CustomDtoMapper.cs is being modified. Running add-migration...

Welcome to .NET Core 3.1! --------------------- SDK Version: 3.1.100

Telemetry --------- The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

---------------- Explore documentation: https://aka.ms/dotnet-docs Report issues and find source on GitHub: https://github.com/dotnet/core Find out what's new: https://aka.ms/dotnet-whats-new Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs Write your first app: https://aka.ms/first-net-core-app -------------------------------------------------------------------------------------- Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET Core program, but dotnet-ef does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. Running update-database... Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET Core program, but dotnet-ef does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. -> persons.component.ts is being generated. -> persons.component.html is being generated. -> create-or-edit-person-modal.component.html is being generated. -> create-or-edit-person-modal.component.ts is being generated. -> view-person-modal.component.html is being generated. -> view-person-modal.component.ts is being generated. -> main.module.ts is being modified. -> main-routing.module.ts is being modified. -> app-navigation.service.ts is being modified. -> service-proxy.module.ts is being modified. -> AspZeroAngularDemo.xml is being modified.

Code generation is complete. Press ENTER to exit...

Hi,

I am getting a 500 error when I attempt to call a Service method that is overloaded.

The interesting observation in the error is the parameters are being replaced by MyApp.Intranet.Application, which is possibly making them identical calls.

Does the AppService support overloads and how should we implement? Thanks

Code:

    Task<PagedResultDto<UserProfileListDto>> GetUsersWithProfiles();

    Task<PagedResultDto<UserProfileListDto>> GetUsersWithProfiles(GetUserProfileListInput input);

When hitting the service url in the browser I expect json data returned but receive the following error. http://localhost:45777/api/services/app/User/GetUsersWithProfiles

AmbiguousActionException: Multiple actions matched. The following actions matched route data and had all constraints satisfied:

VanEck.Intranet.Authorization.Users.UserAppService.GetUsersWithProfiles (MyApp.Intranet.Application) VanEck.Intranet.Authorization.Users.UserAppService.GetUsersWithProfiles (MyApp.Intranet.Application)

<br> <br>

We are having problems with dependencies issues for several AspNetZero projects. The project builds and runs but I don't believe it should have missing dependencies.

Project affected are Web.Core, Web.Host, Web.Mvc and Web.Public. See example screenshot below.

Options selected during creation: ASP.NET CORE MVC & jQuery, ANZ v4.5.1 and .NET Framework 4.6.1

Also please note that there is another issue, possible related, in which I will create a separate topic for if needed. The styling of both Public and MVC sites, aesthetically look terrible. See below screenshot

Public Website

Any help is appreciated, Ron

Showing 1 to 9 of 9 entries