Base solution for your next web application

Activities of "SBJ"

Hi Musa,

Yes, almost 14.300 records.

Greetings, Dave

Hi Musa,

No, no error and no INFO lines.

I just checked with postman and any call from a 'congested' user takes about 1 minute and 40 seconds..

Greetings, Dave

Product version: 8.7 Product type: MVC / Jquery Product framework type: ASP .NET CORE 3.1

Hi,

For our (MVC / Vue) Front-ends we use an APIUser account to do token based authentication with the ASP.net zero back-end to call a number of AppServices.

The problem is that after a while depending on the load of the front-end (number of token authentications) the user becomes unusable because the token authentication takes a very long time or eventually time-outs. If we try to use postman for example, we get the same behaviour. The only solution is creating a new user with the same permissions and use that one, until the problem occurs again.

Is this a cache-issue or is there another way to solve this, or, so to say, reset the user?

Thanks,

Dave van de Ven

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

Hi,

All our migration files are working fine. However, after adding the most recent one, the tenant screen pops up with internal server error and doesn't create the tenant. It crashes and throws an exception at this place (added try-catch myself):

try { 
    // Create Tenant DB
    _abpZeroDbMigrator.CreateOrMigrateForTenant(tenant);
}
catch (Exception ex)
{
    throw ex;
}      

The error is as follows:

But I cannot find anything identifier related? All the entities in the DbContext are properties instead of fields and they all have a primary key with uniqueidentifier, so what is the identifier that it is whining about here?

This is the most recent migration that I added:

public partial class Alter_Mistaken_Definitions : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<long>(
                name: "CampaignId",
                table: EntityDefinitions.ActivationCode,
                nullable: false);

            migrationBuilder.AddForeignKey(
                name: "FK_ActivationCode_Campaign_CampaignId",
                table: EntityDefinitions.ActivationCode,
                column: "CampaignId",
                principalTable: EntityDefinitions.Campaign,
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AlterColumn<int>(
                name: "Quantity",
                table: EntityDefinitions.HandlingLine,
                nullable: true,
                oldClrType: typeof(long),
                oldType: "bigint",
                oldNullable: true);

            migrationBuilder.AddColumn<char[]>(
                name: "Code",
                table: EntityDefinitions.CampaignType,
                nullable: false);

            migrationBuilder.AddColumn<string>(
                name: "Password",
                table: EntityDefinitions.Registration,
                nullable: true,
                defaultValue: string.Empty);

            migrationBuilder.AddColumn<bool>(
                name: "Percentage",
                table: EntityDefinitions.HandlingLine,
                nullable: false);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn("CampaignId", EntityDefinitions.ActivationCode);

            migrationBuilder.DropForeignKey("FK_ActivationCode_Campaign_CampaignId", EntityDefinitions.ActivationCode);

            migrationBuilder.AlterColumn<long>(
                name: "Quantity",
                table: EntityDefinitions.HandlingLine,
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.DropColumn("Code", EntityDefinitions.CampaignType);
            migrationBuilder.DropColumn("Password", EntityDefinitions.Registration);
            migrationBuilder.DropColumn("Percentage", EntityDefinitions.HandlingLine);
        }
    }

Any advice would be nice.

Thanks!

Hello @ismcagdas,

Thanks for your suggestion. We tried to incorporate UnitOfWork but no luck. For normal database transactions like fetching data, we are able to retrieve/access SetTenantId()'s dedicated database but for a hangfire job it still refers to the Default (Host) database.

For instance while setting the Db Connection for Hangfire, the connectionString is set to "Default" which will be the Host database. We assume that is the reason why it uses the Default(Host) database for Hangfire always irrespective of UnitOfWork.

 if (WebConsts.HangfireDashboardEnabled)
            {
                //Hangfire (Enable to use Hangfire instead of default job manager)
                services.AddHangfire(config =>
                {
                    config.UseSqlServerStorage(_appConfiguration.GetConnectionString("Default"));
                });
            }

We need to switch the DbContext to dedicated databses for our Hangfire jobs too instead of using Default(Host) database for all tenants. Is there a way where we could resolve the connectionString and switch to dedicated tenant's database for Hangfire jobs too?

  • What is your product version? - 8.7.0
  • What is your product type (Angular or MVC)? - MVC
  • What is product framework type (.net framework or .net core)? - .NET Core
  • Database & Deployment Architectures - Single Deployment - Multiple Database

Hello, We are trying to implement Hangfire to run recurring background job. We have setup the initial steps of enabling HangfireDashboardEnabled and using the Hangfire dashboard. The Hangfire always uses the Default connectionString that is set in Startup.cs files in *.Web.MVC and *.Web.Host.

We would ideally want the jobs to be executed in the respective tenant database and not in the host database (Default).

Could you please suggest on how the connectionString for the Hangfire server be resolved dynamically based on logged in tenant.

Question
  • What is your product version? 8.7.0
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .NET Core

Hi,

We've currently set up an integrated Vue front-end as a separate C# project as part of the solution.

Everything is working as intended on the Vue side, but we're encountering problems registering services in general. We've set it up as follows:

  1. We've added an IFrontEndService and its implementation FrontEndService inside our project RMS.Web.Mvc. The interface inherits from IApplicationService and the implementation inherits from RMSApplicationBase, IFrontEndService
  2. Our front-end Vue project, RMS.Web.Website.Name, contains an ApiController that uses IoC to inject IFrontEndService.
  3. The Startup.cs of this front-end project registers IFrontEndService as Singleton.

However, after doing this, it still gives us the following error:

AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: RMS.Web.Mvc.Services.IFrontEndService Lifetime: Singleton ImplementationType: RMS.Web.Mvc.Services.FrontEndService': Unable to resolve service for type 'RMS.SBJ.CampaignProcesses.ICampaignsAppService' while attempting to activate 'RMS.Web.Mvc.Services.FrontEndService'.)

So, after that we decided to also register ICampaignsAppService, but then it starts "chaining" into more errors such as the IRepository<TK, TPK> entities that are injected into ICampaignsAppService's implementation, and so on and so on...

AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: RMS.SBJ.CampaignProcesses.ICampaignFormsAppService Lifetime: Singleton ImplementationType: RMS.SBJ.CampaignProcesses.CampaignFormsAppService': Unable to resolve service for type 'Abp.Domain.Repositories.IRepository`2[RMS.SBJ.CampaignProcesses.CampaignForm,System.Int64]' while attempting to activate 'RMS.SBJ.CampaignProcesses.CampaignFormsAppService'.) (Error while validating the service descriptor 'ServiceType: RMS.SBJ.CampaignProcesses.ICampaignsAppService Lifetime: Singleton ImplementationType: RMS.SBJ.CampaignProcesses.CampaignsAppService': Unable to resolve service for type 'Abp.Domain.Repositories.IRepository`2[RMS.SBJ.CampaignProcesses.Campaign,System.Int64]' while attempting to activate 'RMS.SBJ.CampaignProcesses.CampaignsAppService'.) (Error while validating the service descriptor 'ServiceType: RMS.Web.Mvc.Services.IFrontEndService Lifetime: Singleton ImplementationType: RMS.Web.Mvc.Services.FrontEndService': Unable to resolve service for type 'Abp.Domain.Repositories.IRepository`2[RMS.SBJ.CampaignProcesses.Campaign,System.Int64]' while attempting to activate 'RMS.SBJ.CampaignProcesses.CampaignsAppService'.)

Is there a way to register the IFrontEndService without having to also manually register every single injection present in every app service that the IFrontEndService will eventually use? Because that would mean literally having to register every single app service that is ever used, and also every IRepository's inserted type (which are entities, not even services).

Any help would be appreciated.

Hi @ismcagdas

Considering we're running across a problem that is more of a "superset" to this problem, I'll close this and open a new issue. Thanks. :-)

Hi @ismcagdas

I see. We'll download the Angular version and see if we can use that as an example to make it work for us.

Thanks for the swift reply.

Hi @ismcagdas

The reason is because we've integrated Vue as a C# project in the solution (basically similar to the Public project, but then with a Vue bootstrapping). We need to be able to authenticate and authorize in Startup.cs instead of using a controller, that's why we went for a service approach instead of a controller approach. We've stored our credentials in the appsettings.json, because the front-end is JS based and we would prefer not having "traceable" credentials present there with a controller call.

And if the above isn't best practice for this scenario, what would you suggest be the best approach for this, so that front-end users with the know-how wouldn't be able to abuse traceability of credentials and check the transpiled/compiled JS?

Showing 1 to 10 of 22 entries