Base solution for your next web application

Activities of "mbit"

Hi,

to use hangfire, i do: Configuration.BackgroundJobs.UseHangfire(configuration => { configuration.GlobalConfiguration.UseSqlServerStorage("Default"); });

but how can i pass a queue configuration to hangfire as described below in the hangfire documentation: <a class="postlink" href="http://docs.hangfire.io/en/latest/background-processing/configuring-queues.html">http://docs.hangfire.io/en/latest/backg ... ueues.html</a>

thank's in advance martin

Hi,

to implement a custom api for external use i want to implement hmac authentification via a custom attribute like this:

namespace xxx.Api.Controllers
{
	[Audited]
	[MeHmacAuthentication]
	public class ExportController : MeApiControllerBase
...

In a standalone mvc app all worked, but now i migrate the whole project to abp style.

In the implementation of the attribute i do: (McHmacAuthenticationAttribute is a common baseclass doing the most things)

namespace xxx.Authentication
{
    
    public class MeHmacAuthenticationAttribute : McHmacAuthenticationAttribute
    {
        private readonly IMeApiKeyAppService _apikeyService;
		public MeHmacAuthenticationAttribute(IMeApiKeyAppService apikeyService)
        {
            _apikeyService = apikeyService;

            ListResultOutput<MeApiKeyListDto> keys = _apikeyService.GetKeys();
...

but _apikeyService does not get injected. I tried to manually register:

public class MeApiModule : AbpModule
	{
		public override void PreInitialize()
		{
			Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
		}

		public override void Initialize()
		{
			IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
			IocManager.Register<IMeApiKeyAppService, MeApiKeyAppService>(DependencyLifeStyle.Transient);
		}

		public override void PostInitialize()
		{
			base.PostInitialize();
		}

but this did not change anything.

can you please guide me to thi right direction to do this

thanks in advance Martin

Hi,

thanks a lot - it works.

Now i ran into another problem. my main website should only start backgroundjobs and display it's progress etc. (including hangfire dashboard)

and a second "worker" website - hosted on another server should process the jobs.

so i tried:

Configuration.BackgroundJobs.IsJobExecutionEnabled = false;

in the website (webmodule->PreInitialize()) to prevent processing. But i seams that this setting is beeing ignored. Website is processing jobs too.

Is there another option to prevent processing jobs by hangfire? any hint for me?

best regards Martin

Hi,

i just want to implement a service that starts some background jobs via hangfire, so i do:

public class MeEmailService : MeAppServiceBase, IMeEmailService
	{
		protected IMeEmailSendService _SendService;
		protected readonly ITenantSettingsAppService _TenantSettingsAppService;
		protected readonly IBackgroundJobManager _backgroundJobManager;

		public MeEmailService(ITenantSettingsAppService TenantSettingsAppService, IBackgroundJobManager backgroundJobManager)
		{
			_TenantSettingsAppService = TenantSettingsAppService;
			_backgroundJobManager = backgroundJobManager;
...

But somthing is missing, because i get this error at runtime: An error has occurred.","exceptionMessage":"Can't create component 'Abp.BackgroundJobs.BackgroundJobStore' as it has dependencies to be satisfied.\r\n\r\n'Abp.BackgroundJobs.BackgroundJobStore' is waiting for the following dependencies:\r\n- Service 'Abp.Domain.Repositories.IRepository`2[[Abp.BackgroundJobs.BackgroundJobInfo, Abp, Version=0.11.1.0, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.

any hint for me what i am missing?

best regards Martin

Hi,

i added some custom entities like that:

namespace xxx.EntityFramework
{
    public class MeDbContext : AbpZeroDbContext<Tenant, Role, User>
    {
        /* Define an IDbSet for each entity of the application */
        public virtual IDbSet<MeLogEntry> MeLogEntries { get; set; }
		public virtual IDbSet<MeApiKey> MeApiKeys { get; set; }
		public virtual IDbSet<MeBlacklist> MeBlackLists { get; set; }
...

Hi,

same problem when i try to inject the TenantAppService:

Can't create component '_1701apps.effairs.MultiTenancy.TenantManager' as it has dependencies to be satisfied.

'_1701apps.effairs.MultiTenancy.TenantManager' is waiting for the following dependencies:

  • Service 'Abp.Domain.Repositories.IRepository`1[[_1701apps.effairs.MultiTenancy.Tenant, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.MultiTenancy.TenantFeatureSetting, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Editions.EditionManager' which was registered but is also waiting for dependencies. '_1701apps.effairs.Editions.EditionManager' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`1[[Abp.Application.Editions.Edition, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null]]' which was not registered.
  • Service 'AbpZeroFeatureValueStore' which was registered but is also waiting for dependencies. 'AbpZeroFeatureValueStore' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.MultiTenancy.TenantFeatureSetting, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`1[[_1701apps.effairs.MultiTenancy.Tenant, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Application.Features.EditionFeatureSetting, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Authorization.Roles.RoleManager' which was registered but is also waiting for dependencies. '_1701apps.effairs.Authorization.Roles.RoleManager' is waiting for the following dependencies:
  • Service '_1701apps.effairs.Authorization.Roles.RoleStore' which was registered but is also waiting for dependencies. '_1701apps.effairs.Authorization.Roles.RoleStore' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`1[[_1701apps.effairs.Authorization.Roles.Role, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Authorization.Users.UserRole, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Authorization.Roles.RolePermissionSetting, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Authorization.Users.UserEmailer' which was registered but is also waiting for dependencies. '_1701apps.effairs.Authorization.Users.UserEmailer' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`1[[_1701apps.effairs.MultiTenancy.Tenant, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null]]' which was not registered.
  • Service '_1701apps.effairs.MultiTenancy.Demo.TenantDemoDataBuilder' which was registered but is also waiting for dependencies. '_1701apps.effairs.MultiTenancy.Demo.TenantDemoDataBuilder' is waiting for the following dependencies:
  • Service 'Abp.Organizations.OrganizationUnitManager' which was registered but is also waiting for dependencies. 'Abp.Organizations.OrganizationUnitManager' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Organizations.OrganizationUnit, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Authorization.Users.UserManager' which was registered but is also waiting for dependencies. '_1701apps.effairs.Authorization.Users.UserManager' is waiting for the following dependencies:
  • Service '_1701apps.effairs.Authorization.Users.UserStore' which was registered but is also waiting for dependencies. '_1701apps.effairs.Authorization.Users.UserStore' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`2[[_1701apps.effairs.Authorization.Users.User, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Authorization.Users.UserLogin, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Authorization.Users.UserRole, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`1[[_1701apps.effairs.Authorization.Roles.Role, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Authorization.Users.UserPermissionSetting, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Authorization.Roles.RoleManager' which was registered but is also waiting for dependencies.- Service 'Abp.Domain.Repositories.IRepository`1[[_1701apps.effairs.MultiTenancy.Tenant, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Organizations.OrganizationUnit, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Authorization.Users.UserOrganizationUnit, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Authorization.Users.UserLoginAttempt, Abp.Zero, Version=0.11.0.2, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Storage.DbBinaryObjectManager' which was registered but is also waiting for dependencies. '_1701apps.effairs.Storage.DbBinaryObjectManager' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`2[[_1701apps.effairs.Storage.BinaryObject, _1701apps.effairs.Core, Version=1.2.19.77, Culture=neutral, PublicKeyToken=null],[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Authorization.Users.UserManager' which was registered but is also waiting for dependencies.- Service 'Abp.Notifications.NotificationSubscriptionManager' which was registered but is also waiting for dependencies. 'Abp.Notifications.NotificationSubscriptionManager' is waiting for the following dependencies:
  • Service 'Abp.Notifications.NotificationStore' which was registered but is also waiting for dependencies. 'Abp.Notifications.NotificationStore' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Notifications.NotificationInfo, Abp, Version=0.11.1.0, Culture=neutral, PublicKeyToken=null],[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Notifications.TenantNotificationInfo, Abp, Version=0.11.1.0, Culture=neutral, PublicKeyToken=null],[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Notifications.UserNotificationInfo, Abp, Version=0.11.1.0, Culture=neutral, PublicKeyToken=null],[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.Notifications.NotificationSubscriptionInfo, Abp, Version=0.11.1.0, Culture=neutral, PublicKeyToken=null],[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service '_1701apps.effairs.Notifications.AppNotifier' which was registered but is also waiting for dependencies. '_1701apps.effairs.Notifications.AppNotifier' is waiting for the following dependencies:
  • Service 'Abp.Notifications.NotificationPublisher' which was registered but is also waiting for dependencies. 'Abp.Notifications.NotificationPublisher' is waiting for the following dependencies:
  • Service 'Abp.Notifications.NotificationStore' which was registered but is also waiting for dependencies.- Service 'Abp.BackgroundJobs.BackgroundJobManager' which was registered but is also waiting for dependencies. 'Abp.BackgroundJobs.BackgroundJobManager' is waiting for the following dependencies:
  • Service 'Abp.BackgroundJobs.BackgroundJobStore' which was registered but is also waiting for dependencies. 'Abp.BackgroundJobs.BackgroundJobStore' is waiting for the following dependencies:
  • Service 'Abp.Domain.Repositories.IRepository`2[[Abp.BackgroundJobs.BackgroundJobInfo, Abp, Version=0.11.1.0, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
  • Service 'Abp.Notifications.NotificationDistributer' which was registered but is also waiting for dependencies. 'Abp.Notifications.NotificationDistributer' is waiting for the following dependencies:
  • Service 'Abp.Notifications.NotificationStore' which was registered but is also waiting for dependencies.- Service 'AbpZeroFeatureValueStore' which was registered but is also waiting for dependencies.- Service 'Abp.MultiTenancy.IAbpZeroDbMigrator' which was not registered.

I use the top-service (emailservice, wich then uses tenant an jobservice) from a ApiController - maybe this matters?

Hi,

i did not override OnModelCreating.

May it cause a problem that in the .application Project is another dbcontext (for some legacy reasons - we migrate an existing web-app)?

thanks for your help.

Hello there, I have set up a project using Single Deployment - Multi Database approach. I login using a tenant admin (the one that is created on creating a new tenant, and is stored in tenant database). Under Settings - Appearance, I should be able to upload a tenant-specific css/logo. However, when I try this, a DBUpdateException is thrown, because of the FK Constraint (Table Tenant -> LastModifierUserId). So basically the system tries to set the tenant admin-user as LastModifierUser on the Tenant-Row of the host table, but since this user only exists in the tenant-database, it cannot be set. How can I solve this issue now? Is this a bug in Abp? Or is my setup causing the issue?

Thanks in advance

Hey, thanks for your response. I am running Abp Version 2.0.2 here. What is the expected result anyway? If a tenant-user uploads a Css/Logo, which UserId should be set as LastModifiedUser?

Showing 1 to 9 of 9 entries