Open Closed

Facing with module duplication when installing ABP modules into a solution that was originally generated using the ABP open-source version template. #10164


User avatar
0
mohmmd.khalaf@gmail.com created

Dear ABP Support Team,

I am requesting assistance regarding a consistent issue I am facing with module duplication when installing ABP modules into a solution that was originally generated using the ABP open-source version template.

When adding commercial/pro modules such as the Account Admin, Account Public, and other Account-related modules, the framework reports duplicate registrations and conflicts across the DomainShared, Domain, ApplicationContracts, and Application layers. These duplications occur even when following the documented dependency structure and recommended layering.

The main symptoms include:

Duplicate localization resource registrations

Duplicate module dependencies being detected

Errors such as: “Resource already added,” “Module already registered,” or similar conflicts

Module layering inconsistencies caused by mixing open-source and commercial package sets

At this point, I am unable to cleanly integrate the required modules into the open-source solution without manually restructuring dependencies or removing modules that should normally coexist.

I would appreciate your guidance on:

Whether additional steps are required when integrating commercial modules into a project created from the open-source startup template.

Whether there are known compatibility gaps or required configuration changes between OS and commercial module sets.

A recommended or officially supported module dependency structure that prevents cross-layer duplication.

Any patches or upcoming updates that will address these module registration conflicts.

Please advise on the best path forward so I can proceed with a stable and maintainable module configuration.


14 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution To integrate ABP Commercial modules (e.g., Account Admin/Public, Identity Pro, etc.) into a solution originally created with the open-source Angular template (ABP v10) without duplication conflicts, follow this verified, step-by-step plan:

    A) Prefer a Commercial Base or Convert the Solution

    • Best practice: create your solution from the ABP Commercial startup template (Angular) or convert your existing open-source solution to commercial. This avoids mixing “Basic” (open-source) and “Pro” packages that define the same resources/modules.
    • Why: mixing Basic and Pro modules causes duplicate localization resources, duplicated module registrations, and layered dependency conflicts because both sets bring overlapping services/resources.
    • Current platform direction: ABP is unifying docs and tooling and working on a tool to convert open-source solutions to commercial (see “Providing a tool to automatically convert ABP solutions created with open source startup templates into ABP commercial”). Until that tooling is generally available, manual conversion or recreating from the commercial template is recommended.

    B) If You Must Integrate Pro Modules Into an Existing Open-Source Solution

    1. Remove Basic counterparts before adding Pro:

      • Replace open-source module packages with their Pro equivalents:
        • Volo.Abp.Account -> Volo.Account.Pro (Account Admin/Public)
        • Volo.Abp.Identity -> Volo.Identity.Pro
        • Any other module that has a Pro variant should not coexist with its Basic variant.
      • Ensure you remove the Basic packages from all layers (Domain.Shared, Domain, ApplicationContracts, Application, HttpApi, HttpApi.Host) and from Angular package.json if the UI has corresponding NPM packages.
    2. Align module dependencies in each layer:

      • In your module classes, ensure DependsOn uses the Pro modules only. Example:
    [DependsOn(
           typeof(AbpAutofacModule),
           typeof(AbpAspNetCoreMvcModule),
           typeof(AbpIdentityHttpApiModule), // if using Identity.Pro, ensure the Pro HttpApi module is referenced
           typeof(AccountAdminHttpApiModule) // Account Admin Pro HttpApi module
         )]
         public class MyProjectHttpApiModule : AbpModule
         {
         }
    
    • Do the same alignment for DomainShared, Domain, ApplicationContracts, and Application modules so no Basic module remains referenced.
    1. Clean up duplicated localization resources:

      • Duplicates often come from both Basic and Pro packages registering the same resource names.
      • After removing Basic packages, delete bin/obj folders for all projects, restore, and rebuild to clear stale assemblies. This typically resolves “Resource already added” errors.
      • If you have custom localization registrations that overlap with Pro module resource names, rename your custom resource or remove the manual registration.
    2. Keep package versions consistent:

      • Ensure all ABP packages (Framework and Commercial) target the same major/minor version (v10.x.x).
      • Mismatched versions can reintroduce duplicate registrations and breaking changes.
    3. Add the correct Admin/Public packages for the UI scenario:

      • For Angular + Single Host (no separated AuthServer), install the Account Admin and Account Public Pro packages in the server solution (HttpApi, Application, etc.) and integrate Angular UI packages only from the Commercial set (avoid Basic NPM packages).
      • If a module has separate Admin and Public packages, include only the ones you need. Do not mix Admin/Public with Basic module UI for the same domain.
    4. Use ABP Suite/Studio when possible:

      • ABP Suite/Studio for Commercial solutions will add the correct package set and wiring automatically for Pro modules, minimizing manual dependency errors.
      • If Suite reports template issues, ensure Suite version matches your project’s ABP version, then clean bin/obj.

    C) Known Compatibility Considerations and Workarounds

    • Don’t mix Basic and Pro versions of the same module. This is the primary cause of duplicate module and resource registrations.
    • Some modules expose overlapping permissions/features. When you replace Basic with Pro, permissions and resources come from Pro; remove any leftover Basic-based permission providers in your code.
    • For cases similar to duplicate registrations in IdentityServer/OpenIddict historically reported by users, the root fix is consistent module selection and version alignment. Temporary overrides (like replacing stores) should be avoided in favor of consistent Pro-only packages.

    D) Recommended Dependency Structure (high-level)

    • Domain.Shared: only Pro module Domain.Shared packages for modules you use (e.g., Volo.Account.Pro.Domain.Shared, Volo.Identity.Pro.Domain.Shared).
    • Domain: corresponding Pro Domain packages.
    • ApplicationContracts: Pro Application.Contracts packages.
    • Application: Pro Application packages.
    • HttpApi: Pro HttpApi packages.
    • HttpApi.Host / Web: Pro Web layer packages as applicable (match your Angular + single host scenario).
    • Angular UI: use Commercial Angular packages for the modules you include; remove any Basic UI packages for the same modules.

    E) Upgrades and Patches

    • Follow ABP Commercial release notes/change logs before upgrading. Ensure all Pro packages upgrade together to the same version to avoid regressions and duplication errors introduced by partial upgrades.
    • If you encounter a module-level bug after ensuring a pure-Pro setup, check the ABP repository/release notes for fixes and apply the matching patch release.
    1. Sources
    • Modularity basics and DependsOn usage:
      • https://abp.io/docs/latest/framework/architecture/modularity/basics
    • ABP Free vs Pro modules overview (do not mix Basic with Pro for the same module):
      • https://abp.io/docs/latest/others/free-licenses-vs-pro-licenses
    • ABP Framework repository (open modules source and history for compatibility context):
      • https://github.com/abpframework/abp

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    mohmmd.khalaf@gmail.com created

    I see this not practical solution to install pro modules to solution created by open-source version any how i migrated my code to new solution created by commercial version but i have issue installing ELSA workflow module when installing module empty DB migration created

  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution You’re on the right path by moving to a Commercial-based solution. For the Elsa Workflow (Pro) “empty migration” issue, use this checklist to generate actual EF Core migrations for Elsa tables and avoid empty/duplicate migrations:

    A) Install and reference the correct Elsa (Pro) integration

    • Use the ABP Elsa Pro integration modules (they mainly wire auth/permissions). You still need to register Elsa’s EF Core persistence (Elsa.Persistence.EntityFramework.SqlServer) so migrations have real model changes to detect.

    In your Host module (the service where Elsa will run):

    [DependsOn(
        typeof(Volo.Elsa.Abp.AspNetCore.AbpElsaAspNetCoreModule),
        typeof(Volo.Elsa.Abp.Identity.AbpElsaIdentityModule),
        typeof(Volo.Elsa.Abp.Application.AbpElsaApplicationModule),
        typeof(Volo.Elsa.Abp.Application.Contracts.AbpElsaApplicationContractsModule)
    )]
    public class MyProjectHttpApiHostModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            var configuration = context.Services.GetConfiguration();
            var elsaSection = configuration.GetSection("Elsa");
    
            context.Services.AddElsa(elsa => elsa
                .UseEntityFrameworkPersistence(ef =>
                    DbContextOptionsBuilderExtensions.UseSqlServer(
                        ef, configuration.GetConnectionString("Default")))
                .AddHttpActivities(elsaSection.GetSection("Server").Bind)
                .AddQuartzTemporalActivities()
                .AddJavaScriptActivities()
                .AddWorkflowsFrom<Startup>() // optional
            );
    
            context.Services.AddElsaApiEndpoints();
    
            Configure<AbpAntiForgeryOptions>(options =>
            {
                options.AutoValidateFilter = type =>
                    type.Assembly != typeof(Elsa.Server.Api.Endpoints.WorkflowRegistry.Get).Assembly;
            });
    
            context.Services.AddCors(cors => cors.AddDefaultPolicy(builder =>
                builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()
                       .WithExposedHeaders("Content-Disposition")));
        }
    
        public override void OnApplicationInitialization(ApplicationInitializationContext context)
        {
            var app = context.GetApplicationBuilder();
            app.UseCors();
            app.UseHttpActivities();
            app.UseConfiguredEndpoints();
        }
    }
    

    Add to appsettings.json:

    {
      "ConnectionStrings": {
        "Default": "Server=...;Database=...;Trusted_Connection=False;User Id=...;Password=...;"
      },
      "Elsa": {
        "Http": {
          "BaseUrl": "https://localhost:5001"
        }
      }
    }
    

    B) Ensure you are creating migrations from the project that contains Elsa’s DbContext

    • Elsa’s EF entities are registered by AddElsa(). You should add migrations from the host project that references Elsa.Persistence.EntityFramework.SqlServer and where UseEntityFrameworkPersistence is configured.
    • From that project folder, run:
      • dotnet tool restore (if needed)
      • dotnet ef migrations add AddElsaTables -c ElsaContext -o Migrations/Elsa
      • dotnet ef database update If you still get an empty migration:
    • Clean bin/obj, ensure the project builds, then re-run the migrations command.
    • Confirm your host project targets the same TFM as EF tools (e.g., net8.0) and that the Default connection string is valid.

    C) If you use microservices or an external Auth Server, wire identity consistently

    • When Elsa Pro is used with ABP Identity/OpenIddict, missing identity integration may block initialization paths. In microservices setups, configure UseAbpIdentity in the Identity service when using Elsa’s integration for authentication, as reported by other users. This resolved a similar “not progressing” setup where migrations appeared empty until the integration was correct.

    D) Use DbMigrator vs package manager console

    • For ABP, Update-Database in PMC only applies schema. Seeding (and some initializations) are performed by the DbMigrator executable. After generating migrations for Elsa, prefer to run your solution’s DbMigrator (or the host app once) to apply schema and seed. If you don’t have a DbMigrator that runs Elsa, you can still use dotnet ef database update for schema but handle seeding via Elsa or a custom seed.

    E) Verify with the official sample

    • Compare your setup against the Elsa Workflows sample. Ensure:
      • Elsa.UseEntityFrameworkPersistence is configured against your Default connection.
      • The host where you run migrations references Elsa.Persistence.EntityFramework.SqlServer.
      • The app runs and exposes Elsa endpoints without antiforgery issues and with CORS if Studio is separate.

    Quick troubleshooting summary for “empty migration”:

    • Wrong project targeted for migrations → run from the host project that registers Elsa EF persistence.
    • Missing Elsa.Persistence.EntityFramework.SqlServer reference in the host project → add it.
    • Build artifacts cached → delete bin/obj, rebuild, retry.
    • Tooling mismatch (TFM) → ensure EF tools target matches project TFM.
    • Identity integration blocking execution in microservices → configure UseAbpIdentity in Identity microservice (if applicable), then proceed.
    1. Sources
    • Elsa Module (Pro) overview and status:
      • https://abp.io/docs/10.0/modules/elsa-pro
    • ABP Module/DependsOn basics:
      • https://abp.io/docs/latest/framework/architecture/modularity/basics
    • Elsa Workflows sample (compare working setup):
      • https://abp.io/docs/latest/samples/elsa-workflows-demo
    • Microservices Q&A showing Identity integration fix (UseAbpIdentity) for Elsa setup:
      • https://abp.io/support/questions/10150
    • Why DbMigrator is preferred over Update-Database for seeding:
      • https://abp.io/support/questions/4

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Elsa pro module doesn't contain any entities now.

    https://abp.io/docs/10.0/modules/elsa-pro#the-elsa-module

    Thanks.

  • User Avatar
    0
    mohmmd.khalaf@gmail.com created

    So how should related migration added to DB

    Till now it’s not clear for me how Elsa Abp integration works?

    If I added Elsa pro modules shall my host project will act as Elsa server?

    Does this module production ready or still work in progress

  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution
    • Why you see “empty migration” with Elsa Pro:

      • The ABP Elsa Pro integration currently does not add EF Core entities/tables by itself. Per the official module page, Elsa has its own database provider and the ABP Elsa module mainly wires authentication/permissions and integration. Therefore, when you add only the ABP Elsa Pro modules to your solution and run “add-migration”, EF Core finds no new model changes in your application DbContext and generates an empty migration. This is expected with the current status of the module.
    • How to add Elsa database schema:

      • Use Elsa’s own EF Core persistence package and context. The schema comes from Elsa, not from ABP Elsa Pro.
      • In your Host (the application where Elsa endpoints will run):
        1. Reference Elsa EF persistence for your DB provider (e.g., Elsa.Persistence.EntityFramework.SqlServer for SQL Server).
        2. Configure Elsa to use EF persistence against your application’s connection string.
        3. Create and apply migrations for Elsa’s DbContext (ElsaContext) from the host project.

      Example (simplified):

    // In your Host module
      public override void ConfigureServices(ServiceConfigurationContext context)
      {
          var configuration = context.Services.GetConfiguration();
          context.Services.AddElsa(elsa => elsa
              .UseEntityFrameworkPersistence(ef => ef.UseSqlServer(configuration.GetConnectionString("Default")))
              .AddHttpActivities()
              .AddQuartzTemporalActivities()
          );
    
          context.Services.AddElsaApiEndpoints();
      }
    

    Commands (run from the Host project folder that references Elsa.Persistence.EntityFramework.*):

    • dotnet ef migrations add AddElsaTables -c ElsaContext -o Migrations/Elsa
    • dotnet ef database update

    Notes:

    • If a migration still comes out empty, clean bin/obj, ensure the Host builds, and verify that UseEntityFrameworkPersistence is executed in design-time factory or the EF tools can discover ElsaContext.

    • Applying schema vs. seeding: use your solution’s DbMigrator (preferred) to ensure seeding runs; Package Manager Console Update-Database only applies schema.

    • Does your Host act as Elsa Server?

      • Yes, when you add the Elsa server endpoints (AddElsaApiEndpoints) and middleware (e.g., app.UseHttpActivities()) to your Host, that Host becomes the Elsa server for your solution. You can also run Elsa Studio against it (configure CORS accordingly).
    • Production readiness status

      • The ABP Elsa Pro module is under active development and, per the docs, most projects in the module are currently lightweight/empty except for the authentication and permission integrations. You should rely on Elsa’s own persistence and features for workflows. The ABP module is suitable for integrating Elsa into ABP apps, but it is not a full replacement for Elsa’s persistence/features. Treat it as integration glue around Elsa, and use Elsa docs for workflow authoring, storage, and runtime concerns.
    1. Sources
    • Elsa Pro module status and scope:
      • https://abp.io/docs/10.0/modules/elsa-pro
    • ABP modularity basics (DependsOn, layering):
      • https://abp.io/docs/latest/framework/architecture/modularity/basics
    • Sample reference (compare a working setup):
      • https://abp.io/docs/latest/samples/elsa-workflows-demo
    • DbMigrator vs Update-Database (seeding note):
      • https://abp.io/support/questions/4

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    mohmmd.khalaf@gmail.com created

    there is no such package Elsa.Persistence.EntityFramework.

    packages names for elsa V 3 is

    "Elsa.EntityFrameworkCore" Version="3.5.2" Elsa.EntityFrameworkCore.SqlServer" Version="3.5.2"

  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution You’re right for Elsa v3: use Elsa.EntityFrameworkCore and Elsa.EntityFrameworkCore.SqlServer. The “empty migration” happens because ABP’s Elsa Pro modules don’t add entities; you must register Elsa’s own DbContext and create migrations for Elsa’s context (not your app DbContext).

    Do this in your host (the application that will expose Elsa endpoints):

    • Packages (NuGet)

      • Elsa:
        • Elsa.EntityFrameworkCore
        • Elsa.EntityFrameworkCore.SqlServer
        • Plus any Elsa activities you need (e.g., Elsa.Activities.Http)
      • ABP Elsa Pro integration (what you already use):
        • Volo.Elsa.Abp.AspNetCore
        • Volo.Elsa.Abp.Identity
        • Volo.Elsa.Abp.Application, Volo.Elsa.Abp.Application.Contracts (permissions)
    • Configure Elsa EF Core persistence In your Host module’s ConfigureServices:

    using Elsa.EntityFrameworkCore.Extensions;
      using Elsa.EntityFrameworkCore;
      using Microsoft.EntityFrameworkCore;
    
      public override void ConfigureServices(ServiceConfigurationContext context)
      {
          var configuration = context.Services.GetConfiguration();
    
          context.Services
              .AddElsa(elsa =>
              {
                  elsa
                      .UseEntityFrameworkCorePersistence(ef =>
                          ef.UseSqlServer(configuration.GetConnectionString("Default")))
                      .AddHttpActivities()
                      .AddQuartzTemporalActivities();
              });
    
          context.Services.AddElsaApiEndpoints();
      }
    
      public override void OnApplicationInitialization(ApplicationInitializationContext context)
      {
          var app = context.GetApplicationBuilder();
          app.UseHttpActivities();
          app.UseConfiguredEndpoints();
      }
    
    • Create migrations for Elsa’s DbContext
      • From the Host project directory (the one referencing Elsa.EntityFrameworkCore.SqlServer and where UseEntityFrameworkCorePersistence is configured), run:
        • dotnet ef migrations add AddElsaTables -c ElsaContext -o Migrations/Elsa
        • dotnet ef database update Notes:
      • If EF can’t find ElsaContext at design-time, add a design-time factory:
    using Elsa.EntityFrameworkCore;
        using Microsoft.EntityFrameworkCore;
        using Microsoft.EntityFrameworkCore.Design;
        using Microsoft.Extensions.Configuration;
    
        public class ElsaContextFactory : IDesignTimeDbContextFactory<ElsaContext>
        {
            public ElsaContext CreateDbContext(string[] args)
            {
                var config = new ConfigurationBuilder()
                    .AddJsonFile("appsettings.json", optional: false)
                    .AddEnvironmentVariables()
                    .Build();
    
                var options = new DbContextOptionsBuilder<ElsaContext>()
                    .UseSqlServer(config.GetConnectionString("Default"))
                    .Options;
    
                return new ElsaContext(options);
            }
        }
    
    • Clean bin/obj and ensure the project builds before adding the migration.

    • Will your Host act as “Elsa Server”?

      • Yes. When you add AddElsaApiEndpoints() and UseHttpActivities(), your Host exposes Elsa APIs and acts as the Elsa server. Configure CORS if Elsa Studio is hosted elsewhere.
    • Production readiness

      • ABP Elsa Pro is an integration layer (auth/permissions + ABP-friendly wiring). Elsa’s own persistence and runtime are production-grade; the ABP Elsa Pro modules themselves are still evolving and do not replace Elsa features. Use Elsa v3 packages for storage/runtime and the ABP modules for integration.
    1. Sources
    • ABP Elsa Pro module scope/status (integration; no entities):
      • https://abp.io/docs/10.0/modules/elsa-pro
    • ABP modularity (DependsOn/basics):
      • https://abp.io/docs/latest/framework/architecture/modularity/basics
    • Elsa workflows demo (compare structure/integration approach):
      • https://abp.io/docs/latest/samples/elsa-workflows-demo

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The Elsa EF Core packages are:

    <PackageReference Include="Elsa.EntityFrameworkCore" Version="3.5.0" />
    <PackageReference Include="Elsa.EntityFrameworkCore.SqlServer" Version="3.5.0" />
    

    Can you download our demo app?

    See https://abp.io/docs/10.0/modules/elsa-pro#elsa-workflows---sample-workflow-demo

    Thanks.

  • User Avatar
    0
    mohmmd.khalaf@gmail.com created

    I already downloaded demo app but demo app does not show how migration created and the way migration implemented to DB is different than abp approach

  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution You’re right: the ABP Elsa Pro modules don’t add any EF entities. That’s why your “Add-Migration” under your app’s DbContext is empty. With Elsa v3 you must add Elsa’s own EF Core persistence and create migrations for Elsa’s DbContext, then apply them using ABP’s normal migration flow (DbMigrator or runtime migrator).

    Do this:

    • Add Elsa v3 EF packages to the Host (the app that will expose Elsa endpoints):

      • Elsa.EntityFrameworkCore
      • Elsa.EntityFrameworkCore.SqlServer
      • Plus activities you need (e.g., Elsa.Http, Elsa.Scripting.JavaScript, Elsa.Scheduling, etc.)
    • Configure Elsa in the Host

    using Elsa.EntityFrameworkCore;
      using Elsa.EntityFrameworkCore.Extensions;
      using Microsoft.EntityFrameworkCore;
    
      [DependsOn(
          typeof(Volo.Elsa.Abp.AspNetCore.AbpElsaAspNetCoreModule),
          typeof(Volo.Elsa.Abp.Identity.AbpElsaIdentityModule),
          typeof(Volo.Elsa.Abp.Application.AbpElsaApplicationModule),
          typeof(Volo.Elsa.Abp.Application.Contracts.AbpElsaApplicationContractsModule)
      )]
      public class MyProjectHttpApiHostModule : AbpModule
      {
          public override void ConfigureServices(ServiceConfigurationContext context)
          {
              var configuration = context.Services.GetConfiguration();
              var cs = configuration.GetConnectionString("Default");
    
              context.Services
                  .AddElsa(elsa => elsa
                      .UseEntityFrameworkCorePersistence(ef => ef.UseSqlServer(cs))
                      .UseWorkflowManagement()
                      .UseWorkflowRuntime(runtime => runtime.UseEntityFrameworkCore(ef => ef.UseSqlServer(cs)))
                      .UseScheduling()
                      .UseJavaScript()
                      .UseHttp(http => configuration.GetSection("Elsa:Http").Bind(http))
                      .UseWorkflowsApi());
    
              context.Services.AddElsaApiEndpoints();
    
              Configure<AbpAntiForgeryOptions>(o =>
              {
                  // Exclude Elsa API
                  o.AutoValidateFilter = t => t.Assembly != typeof(Elsa.Server.Api.Endpoints.WorkflowRegistry.Get).Assembly;
              });
          }
    
          public override void OnApplicationInitialization(ApplicationInitializationContext context)
          {
              var app = context.GetApplicationBuilder();
              app.UseHttpActivities();
              app.UseConfiguredEndpoints();
          }
      }
    
    • Add a design-time DbContext factory so EF tools can find ElsaContext:
    using Elsa.EntityFrameworkCore;
      using Microsoft.EntityFrameworkCore;
      using Microsoft.EntityFrameworkCore.Design;
      using Microsoft.Extensions.Configuration;
    
      public class ElsaContextFactory : IDesignTimeDbContextFactory<ElsaContext>
      {
          public ElsaContext CreateDbContext(string[] args)
          {
              var cfg = new ConfigurationBuilder()
                  .AddJsonFile("appsettings.json", optional: true)
                  .AddJsonFile("appsettings.Development.json", optional: true)
                  .AddEnvironmentVariables()
                  .Build();
    
              var options = new DbContextOptionsBuilder<ElsaContext>()
                  .UseSqlServer(cfg.GetConnectionString("Default"))
                  .Options;
    
              return new ElsaContext(options);
          }
      }
    
    • Create migrations for Elsa’s DbContext (not your app DbContext):

      • From the Host project folder (that references Elsa.EntityFrameworkCore.SqlServer):
        • dotnet ef migrations add AddElsaTables -c ElsaContext -o Migrations/Elsa
        • dotnet ef database update -c ElsaContext
      • If you still get an empty migration, clean bin/obj, ensure the Host builds, and re-run the command. Make sure the Host actually references the Elsa EF Core packages and the factory above is compiled.
    • Apply in ABP way (recommended):

      • Include the Elsa EF packages in your .DbMigrator project and ensure it references the Host assembly so the design-time factory is discoverable.
      • Run the DbMigrator to apply schema and perform ABP seeding. Note: DbMigrator seeds ABP data; Elsa doesn’t ship ABP seeds, but DbMigrator is still the preferred place to centralize migrations execution.
    • Will the Host act as Elsa Server?

      • Yes. When you call AddElsaApiEndpoints() and UseHttpActivities(), your Host exposes Elsa APIs and becomes the Elsa server. If Elsa Studio is hosted elsewhere, enable CORS for that origin.
    • Production readiness status

      • As documented, the ABP Elsa Pro modules currently focus on integration (auth/permissions). They don’t own persistence. Use Elsa v3 packages for storage/runtime. The integration is production-usable provided you rely on Elsa’s persistence and keep all package versions aligned.
    • Microservice note (if applicable)

      • In microservice setups with a separate Identity service, ensure identity integration is configured correctly. A reported fix was enabling UseAbpIdentity in the Identity microservice when hooking Elsa auth; otherwise, requests to Elsa endpoints can fail even though DB is correct.
    1. Sources
    • Elsa Pro module scope/status (no entities; integration focus):
      • https://abp.io/docs/10.0/modules/elsa-pro
    • Sample workflow demo (compare package list and registration):
      • https://abp.io/docs/latest/samples/elsa-workflows-demo
    • ABP modularity basics:
      • https://abp.io/docs/latest/framework/architecture/modularity/basics
    • Note on DbMigrator vs Update-Database (seeding):
      • https://abp.io/support/questions/4
    • Microservices Q&A mentioning UseAbpIdentity fix with Elsa:
      • https://abp.io/support/questions/10150

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I already downloaded demo app but demo app does not show how migration created and the way migration implemented to DB is different than abp approach

    Yes, Elsa's migration way is different from ABP. It uses https://fluentmigrator.github.io/intro/quick-start.html to migrate at runtime.

    Thanks.

  • User Avatar
    0
    mohmmd.khalaf@gmail.com created

    So this means once i added

    Elsa.EntityFrameworkCore

    Elsa.EntityFrameworkCore.SqlServer

    to my host project when I run host project ELSA migration with be automatically applied?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Yes, you also need to add the Elsa EF core code, then it will create the database after the app starts.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 03, 2025, 13:19
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.