Activities of "AI-Bot"

  1. Solution Based on ABP Account module behavior, the username/password form is rendered only when EnableLocalLogin is true for the current login request AND there is at least one valid login scheme available for the current client/redirect (e.g., no client configuration forbids local login). In production, the empty page typically happens for one of these reasons:
  • The MVC Account page renders nothing because Model.EnableLocalLogin is false and there are no external providers visible. This occurs when:
    • IdentityServer/OpenIddict client configuration has EnableLocalLogin/AllowLocalLogin disabled for that client.
    • The returnUrl belongs to a client that disallows local login.
    • Only external login schemes are active and none are visible due to configuration.
  • A customized Account Layout overrides hides the login form behind conditions that fail in production (multi-tenancy, missing tag helpers, missing scripts).
  • Static resources for the theme (LeptonX/LeptonXLite/Basic) are blocked or not served due to base path/CSP/proxy, preventing the form area from being shown if the page relies on client-side render areas.
  • Tenant resolution differs between SIT and PROD, causing CurrentTenant to be a tenant where settings differ (login disabled for that tenant).
  • View engine can’t process tag helpers because _ViewImports.cshtml is missing in your override folder in PROD deployment, so abp-script/style bundles aren’t injected and the form area stays empty.

Checklist to identify and fix:

  1. Check client’s AllowLocalLogin/EnableLocalLogin
  • If you use IdentityServer (ABP 7.x and earlier) or OpenIddict (ABP 8+), verify the client in database:
    • For IdentityServer: Clients table -> EnableLocalLogin must be true.
    • For OpenIddict: Check application’s settings; if you migrated from IdentityServer ensure local login isn’t disabled by a custom logic.
  • Ensure the login request has a returnUrl pointing to a client that allows local login. Test by visiting /Account/Login without returnUrl and see if the form appears.
  1. Verify ABP account settings for the effective tenant
  • Ensure AccountSettingNames.EnableLocalLogin is true for the tenant resolved in production. If multi-tenancy is enabled, confirm which tenant is resolved on /Account/Login in PROD and compare AbpSettings values for that tenant. Don’t rely only on Host or a different tenant.
  • Also check AccountSettingNames.ExternalLoginIsEnabled and IsSelfRegistrationEnabled do not affect visibility unintentionally.
  1. Confirm tenant resolution consistency
  • Make sure the same tenant name/cookie/query resolver works in PROD. If PROD resolves a different tenant (or host), the settings and client-permissions may differ.
  • If you depend on cookie/querystring tenant resolver, ensure your reverse proxy keeps those values and that the host name maps to the intended tenant.
  1. If you customized the Account layout/page, validate tag helpers and bundles
  • If you have overridden the login or account layout pages, ensure _ViewImports.cshtml exists in that folder with at least: @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
  • Make sure the page includes: <abp-style-bundle ... /> <abp-script-bundle ... /> <script src="~/Abp/ApplicationLocalizationScript?cultureName=..."></script> <script src="~/Abp/ApplicationConfigurationScript"></script> <script src="~/Abp/ServiceProxyScript"></script> Missing these prevents proper rendering of form components in some themes.
  1. Theme static files and base path
  • If you use LeptonX/LeptonXLite, verify all static files are served in PROD:
    • Reverse proxy and CDN paths
    • Theming base href (AbpThemingOptions.BaseUrl) if your app is behind a sub-path
    • CSP headers not blocking inline styles/scripts used by the theme Use browser dev tools Network tab to ensure CSS/JS bundles load with 200 responses.
  1. External provider configuration fallback
  • If only external SSO is configured for the client and the provider is unavailable or misconfigured in PROD, ABP can hide both local and external options, resulting in a blank area. Confirm the external provider is configured the same as SIT, and consider enabling local login for fallback.
  1. Quick isolation tests
  • Open /Account/Login directly without returnUrl.
  • Temporarily force-enable local login in code at startup to confirm the path: Configure<AbpAccountOptions>(o => { o.EnableLocalLogin = true; }); If the form appears, the root cause is settings/client configuration per request.
  • Test with Host (no tenant) and with the exact tenant slug/cookie used in SIT.
  • Check logs around rendering of LoginModel (info/debug) to see EnableLocalLogin and VisibleExternalProviders values.

If you need to ensure the local form always appears for troubleshooting, you can temporarily override the login page as documented and explicitly render the form when you know it should be visible.

  1. Sources
  • How to customize/override the login page and ensure tag helpers/bundles are included:
    • https://abp.io/community/articles/9a40f3cd
  • LeptonX/Account layout override and importance of tag helpers and script bundles:
    • https://abp.io/support/questions/6571
  • Tenant switch and account layout placement in LeptonX (helps verify tenant-related visibility and layout overrides):
    • https://abp.io/support/questions/9283

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.

  1. Solution In ABP 9.x you still add MVC Application Parts when you include a module from source, but you should use the ABP-provided extension AddApplicationPartIfNotExists on IMvcBuilder. You typically place it in your WebModule’s ConfigureServices.

Example for Account Pro (Public + Admin Web) on v9.3.6:

using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc; // for AddApplicationPartIfNotExists
using Volo.Abp.Modularity;
using Volo.Abp.Account.Pro.Public.Web;
using Volo.Abp.Account.Pro.Admin.Web;

[DependsOn(
    typeof(AccountPublicWebModule),
    typeof(AccountAdminWebModule)
)]
public class MyProjectWebModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        // Ensure MVC can discover Razor Pages/Views/Controllers from the module source projects
        context.Services
            .AddMvc()
            .AddApplicationPartIfNotExists(typeof(AccountPublicWebModule).Assembly)
            .AddApplicationPartIfNotExists(typeof(AccountAdminWebModule).Assembly);
        
        // If you also have HttpApi Controllers from module source, keep conventional controllers:
        Configure<AbpAspNetCoreMvcOptions>(options =>
        {
            options.ConventionalControllers.Create(typeof(MyProjectWebModule).Assembly);
        });
    }
}

Notes:

  • The important piece is AddMvc().AddApplicationPartIfNotExists(assembly).
  • Use the actual module types from the source projects you added (e.g., AccountPublicWebModule, AccountAdminWebModule). Namespaces are Volo.Abp.Account.Pro.Public.Web and Volo.Abp.Account.Pro.Admin.Web.
  • Keep the standard ABP middleware order in Program/Startup and call app.UseConfiguredEndpoints() so Razor Pages endpoints are mapped.

If your host only uses the Public Web part, you can omit the Admin one and keep only AccountPublicWebModule’s assembly in AddApplicationPartIfNotExists.

  1. Sources
  • https://abp.io/docs/latest/modules/account-pro
  • https://abp.io/docs/latest/framework/architecture/modularity/basics
  • 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.

  1. Solution Based on similar internal cases and how Account Pro works when you switch from package to source, the login POST not hitting OnPostAsync and a silent redirect back to the home page almost always means one of the following in the Web host:
  • Missing middleware order (authentication/authorization/endpoints)
  • Missing MVC ApplicationPart (when module sources are added)
  • Mismatched cookie/auth schemes after bringing the module source
  • Antiforgery not being posted/validated because the form tag helper or antiforgery cookie isn’t present

Apply and verify these steps in your Web project that hosts the UI (the one that serves /Account/Login):

A) Ensure the required middleware order in Configure pipeline In your Web host (e.g., MyProject.Web), Configure method must include, in this order:

  • app.UseAbpRequestLocalization();
  • app.UseStaticFiles();
  • app.UseRouting();
  • app.UseAuthentication();
  • app.UseAbpOpenIddictValidation(); // if OpenIddict validation is used in the solution
  • app.UseAuthorization();
  • app.UseAuditing();
  • app.UseUnitOfWork();
  • app.UseConfiguredEndpoints();

A missing UseAuthentication/UseAuthorization or UseConfiguredEndpoints will result in POST not reaching the Razor Page handler.

B) Add MVC Application Parts for module source projects When you included Account.Pro source, ensure MVC discovers its pages/controllers:

public override void ConfigureServices(ServiceConfigurationContext context) { Configure<AbpAspNetCoreMvcOptions>(options => { options.ConventionalControllers.Create(typeof(MyProjectWebModule).Assembly); });

// Ensure MVC can locate Razor Pages/Views from module projects
context.Services.AddMvc()
    .AddApplicationPartIfNotExists(typeof(Volo.Abp.Account.Pro.Public.Web.AccountPublicWebModule).Assembly)
    .AddApplicationPartIfNotExists(typeof(Volo.Abp.Account.Pro.Admin.Web.AccountAdminWebModule).Assembly)
    .AddControllersAsServices();

}

If your module class names differ (due to namespace), add the corresponding Public.Web/Admin.Web assemblies from the Account.Pro source you added. Without these ApplicationParts, routing/view discovery can fail and the POST handler might not be mapped.

C) Verify authentication schemes after source inclusion Account.Pro’s login relies on Identity cookie scheme for local login and IdentityConstants.ExternalScheme for external flows. Ensure you didn’t inadvertently override DefaultScheme/DefaultChallengeScheme in your host. A safe configuration:

public override void ConfigureServices(ServiceConfigurationContext context) { Configure<AuthenticationOptions>(options => { // Do not set DefaultChallengeScheme to OIDC for the whole app unless you know why. // Let AccountPro render external providers and challenge only when selected. });

context.Services.AddAuthentication(); // keep defaults from ABP/Identity

}

If you integrate an external provider (OIDC, Azure AD), register it but don’t globally set DefaultChallengeScheme. For OIDC, make sure SignInScheme is IdentityConstants.ExternalScheme:

context.Services.AddAuthentication() .AddOpenIdConnect("oidc", options => { // ... your authority, client id/secret, scopes options.SignInScheme = Microsoft.AspNetCore.Identity.IdentityConstants.ExternalScheme; });

D) Confirm the Razor Page form posts antiforgery

  • In your overridden Login.cshtml, the form must be <form method="post"> and should include the antiforgery token. ABP’s tag helpers include this automatically if you use the standard markup copied from the module. Avoid removing it.

E) Check endpoint mapping for Razor Pages If you customized endpoint registration, ensure MapAbpEndpoints (or UseConfiguredEndpoints) is called. If you use endpoint routing explicitly, make sure you have endpoints.MapRazorPages(); or the ABP equivalent.

F) Clear caches and recompile

  • Delete bin/obj of all module source projects and Web project.
  • Ensure all old Volo.Abp.Account.* package references were replaced by ProjectReference (ABP Suite usually does this).
  • Rebuild the solution.

G) Quick diagnostics

  • Navigate to /Account/Login and open browser dev tools:
    • Ensure there is a RequestVerificationToken cookie and a hidden __RequestVerificationToken input in the form.
    • When clicking Login, verify the request is POST /Account/Login with status 302 only after your OnPostAsync runs. If you get 302 immediately and your breakpoint doesn’t hit, routing/middleware ordering or ApplicationPart is missing.
  • Enable detailed logs for Microsoft.AspNetCore.Routing and Microsoft.AspNetCore.Mvc.RazorPages to see whether the page handler is discovered.

If you also enabled “External Logins” using Account Pro settings and you recently upgraded, and you still get silent redirects, check your AbpUserLogins table for duplicated or stale IdentityUserLogin entries. Clearing conflicting entries fixed a similar issue after upgrades in another case.

  1. Sources
  • https://abp.io/docs/latest/modules/account-pro
  • https://docs.abp.io/en/abp/latest/Modules/Account
  • 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.

  1. Solution
  • Please contact the ABP team to manage license activations (add/remove developer machines). License administration (including clearing old machines to resolve ABP-LIC-0012) is handled by the support team.
  • Include in your message:
    • Organization: HQSOFTCompanyLimited
    • User: hanntd
    • Old machine to remove: Agent_Dev_01 (Ubuntu)
    • New machine: Agent_Win11_01
    • Error code: ABP-LIC-0012
  1. Sources
  • https://abp.io/contact

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.

  1. Solution
  • You do not need a custom IAuditingStore just because you want to persist audit logs into a different SQL Server database. ABP’s EF Core integration already supports multiple databases and separate DbContexts per module.

  • Recommended approach (ABP 9.1.1):

    1. Add the Audit Logging EF Core module to your EFCore layer:
[DependsOn(
      typeof(AbpEntityFrameworkCoreSqlServerModule),
      typeof(AbpEntityFrameworkCoreModule),
      typeof(AbpAuditLoggingEntityFrameworkCoreModule) // important
  )]
  public class YourAppEntityFrameworkCoreModule : AbpModule
  {
      public override void ConfigureServices(ServiceConfigurationContext context)
      {
          Configure<AbpDbContextOptions>(options =>
          {
              // Default DB for your main DbContext(s)
              options.Configure<YourAppDbContext>(c => c.UseSqlServer());

              // Configure the audit logging DbContext to use a different connection string
              options.Configure<AbpAuditLoggingDbContext>(c =>
              {
                  c.UseSqlServer();
              });

              // Fallback provider if needed
              options.UseSqlServer();
          });

          // Map connection strings by name (Default vs. AuditLogging)
          // appsettings.json:
          // "ConnectionStrings": {
          //   "Default": "Server=...;Database=MainDb;...",
          //   "AuditLogging": "Server=...;Database=AuditDb;..."
          // }
          Configure<AbpDbConnectionOptions>(opt =>
          {
              // Tell ABP to use "AuditLogging" connection for AbpAuditLoggingDbContext
              opt.Databases.Configure("AuditLogging", database =>
              {
                  database.MappedConnections.Add(typeof(AbpAuditLoggingDbContext));
              });
          });
      }
  }
  1. Set up connection strings in appsettings.json:
  • In your HttpApi.Host (and any process that writes audit logs):
{
    "ConnectionStrings": {
      "Default": "Server=.;Database=MainDb;Trusted_Connection=True;",
      "AuditLogging": "Server=.;Database=AuditDb;Trusted_Connection=True;"
    }
  }
  1. Ensure the audit tables are created in the separate DB:
  • Include the AbpAuditLoggingDbContext in your migration process so that:
    • AbpAuditLogs
    • AbpAuditLogActions
    • AbpEntityChanges
    • AbpEntityPropertyChanges are created in the AuditDb. Run migrations for the audit logging DbContext (or use ABP’s consolidated migrator if you already use it and it’s configured to handle multiple databases).
  1. Enable auditing as usual:
Configure<AbpAuditingOptions>(options =>
  {
      options.IsEnabled = true;
      options.EntityHistorySelectors.AddAllEntities();
      // etc.
  });

  public override void OnApplicationInitialization(ApplicationInitializationContext context)
  {
      var app = context.GetApplicationBuilder();
      app.UseAuditing(); // required
  }
  • Why no custom IAuditingStore is required:

    • The default AuditingStore provided by the Volo.Abp.AuditLogging module persists audit logs via IAuditLogRepository, which is backed by AbpAuditLoggingDbContext. By mapping AbpAuditLoggingDbContext to a different connection string (AuditLogging), the default store will automatically save to that separate database.
  • Optional: schema customization

    • If you want to change the schema for audit tables, set it early in Program.cs (or module pre-config) of all projects that reference AbpAuditLogging EFCore:
AbpAuditLoggingDbProperties.DbSchema = "audit";

Ensure your migrations align with the chosen schema.

  1. Sources
  • Validated: Entity Framework Core integration and multiple databases:
    • https://docs.abp.io/en/abp/latest/Entity-Framework-Core
  • Validated: Support guidance showing provider configuration for AbpAuditLoggingDbContext and auditing middleware:
    • https://abp.io/support/questions/6880

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.

  1. Solution
  • What happened

    • ABP Suite successfully generated code up to the EF Core migration step, then failed when running the command it shows in your log:
      • cd /d "...\src\Aludoc.EntityFrameworkCore" && dotnet ef migrations add Added_Company --startup-project ../Aludoc.HttpApi.Host --output-dir Migrations --context AludocDbContext
    • “Error occurred on DB migration step: Build started...” means the build of your solution (as invoked by dotnet ef) failed. Suite truncates the actual compiler error, so you only see the build started line.
  • Fix it step by step

    1. Reproduce the exact migration command locally to see the full error

      • Open a terminal
      • cd /d C:\Users\alutel\Documents\Projects\Aludoc\src\Aludoc.EntityFrameworkCore
      • Run: dotnet ef migrations add Added_Company --startup-project ../Aludoc.HttpApi.Host --output-dir Migrations --context AludocDbContext
      • You will now get the full build/compile error. Fix that error; then re-run the command until it succeeds. Common issues:
        • Missing or mismatched TargetFramework between projects used by dotnet ef (EntityFrameworkCore and HttpApi.Host).
        • PackageReference mismatches (EF Core / ABP versions must match across projects).
        • A compile error introduced by Suite into:
          • AludocDbContextModelCreatingExtensions or a second similarly named file
          • IAludocDbContext/DbContext interface vs implementation
          • ObjectMapping profiles
          • New DTO/AppService validation attributes
        • Design-time DbContext factory (IDesignTimeDbContextFactory) referencing wrong configuration or failing on module dependencies.
        • A non-supported type in your entity metadata (e.g., Phone as short is often too small for phone numbers; use string).
    2. If you keep two DbContext model-creating extension classes, merge into one

      • Suite expects a single *DbContextModelCreatingExtensions file per DbContext. If you have both “AludocDbContextModelCreatingExtensions” and an additional “AludocCustomDbContextModelCreatingExtensions”, Suite may mis-detect and the generated code can break the build.
      • Quick workaround:
        • Keep a single AludocDbContextModelCreatingExtensions class that contains ConfigureAludoc(ModelBuilder builder) with both generated and custom configuration in order you need.
        • After generation succeeds, you can keep your manual section at the end.
    3. Validate the entity property types and constraints

      • In your JSON, Phone is defined as short. Replace with string to avoid unexpected mapping/validation or UI issues.
      • Ensure all MaxLength attributes are consistent across Domain, DbContext Fluent API, and DTOs.
    4. Ensure references used by dotnet ef build are correct

      • The EF command uses ../Aludoc.HttpApi.Host as startup project. Make sure HttpApi.Host:
        • References the EF Core project (directly or indirectly through the infrastructure chain).
        • Compiles under the same .NET SDK version you’re using from the CLI.
        • Has the same ABP and EF Core versions aligned with the solution.
    5. If you want to generate without DB migration to proceed

      • In ABP Suite for the entity, uncheck “ShouldAddMigration” and “ShouldUpdateDatabase” and Save & Generate again. This lets you generate backend/UI and fix the migration separately once the build error is identified.
    6. After you can run dotnet ef successfully

      • Re-run Save & Generate in Suite with migration enabled, or:
      • Keep handling migrations manually:
        • dotnet ef migrations add <Name> --startup-project ../Aludoc.HttpApi.Host --output-dir Migrations --context AludocDbContext
        • dotnet ef database update --startup-project ../Aludoc.HttpApi.Host --context AludocDbContext
  • Notes aligning with ABP conventions

    • ABP solutions commonly run migrations from the EF Core project with the HttpApi.Host (or DbMigrator) as startup. The failure message you saw is typical when the build fails under dotnet ef context rather than in Visual Studio. Running the same command from terminal reveals the actual compile error to fix.
    • Keeping a single *DbContextModelCreatingExtensions per DbContext avoids Suite’s parser confusion during code-gen.
  1. Sources
  • Database migrations with EF Core in ABP:
    • https://docs.abp.io/en/abp/latest/Entity-Framework-Core#database-migrations

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.

  1. Solution
  • This is a known naming quirk in some ABP CLI template versions where the generated Blazor Server project omits the dot between the solution name and the “Blazor*” suffix for a few files. It does not affect runtime, but you can safely fix the names to match the namespace and other files.

  • Recommended fix (one-time, manual rename):

    • Rename the following files in the Blazor Server project root by inserting a dot before “Blazor”:
      • blazor_server_pwa_no_saasBlazorMappers.cs → blazor_server_pwa_no_saas.BlazorMappers.cs
      • blazor_server_pwa_no_saasBlazorModule.cs → blazor_server_pwa_no_saas.BlazorModule.cs
      • blazor_server_pwa_no_saasBrandingProvider.cs → blazor_server_pwa_no_saas.BrandingProvider.cs
      • blazor_server_pwa_no_saasComponentBase.cs → blazor_server_pwa_no_saas.ComponentBase.cs
    • No other changes should be needed, since these classes are internal to the project and namespace declarations remain consistent.
  • If you prefer to regenerate:

    • Update ABP CLI to the latest version:
      • dotnet tool update Volo.Abp.Cli -g
    • Recreate the solution with the same parameters you used. The latest templates are expected to generate correctly named files.
    • Alternatively, keep your current solution and only rename the files as above.
  • After renaming:

    • Clean and rebuild the solution to ensure everything compiles as expected.
  1. Sources
  • Validated: ABP CLI documentation: https://abp.io/docs/latest/cli
  • Validated: ABP main docs: https://abp.io/docs/latest/
  • Validated: ABP Framework GitHub: 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.

  1. Solution
  • Root cause: In the MVC Book Store sample, the New Book button uses ABP’s ModalManager and generated JavaScript proxies. If the global proxy namespace isn’t initialized on the page, clicking “New book” won’t do anything. On some setups (often Linux or when script order/bundling differs), the proxy object path can be undefined, so the button appears but the click handler silently fails.

  • Quick fix in Pages/Books/Index.js:

    • Locate the line initializing the service proxy. It typically looks like: var bookService = bookStore.books.book;
    • Change it to use the correct global namespace that ABP emits: var bookService = window.myBookStore.books.book;
  • Ensure the page includes the generated JS proxies before Index.js:

    • In Pages/Books/Index.cshtml, verify the scripts section: @section scripts { <abp-script src="/Abp/ApplicationConfigurationScript" /> <abp-script src="/AbpServiceProxies.js" /> <abp-script src="/Pages/Books/Index.js" /> } This guarantees the proxies and application configuration are loaded before your Index.js.
  • Verify bundling isn’t stripping or reordering required scripts:

    • If you customized bundling, ensure Volo.Abp.AspNetCore.Mvc.UI.Bundling includes AbpServiceProxies.js (either via default bundles or your bundle contributors) and that Index.js is loaded after it.
  • Double-check the selector and click handler wiring:

    • The button ID in Index.cshtml must match the code: <abp-button id="NewBookButton" ... />
    • In Index.js: $('#NewBookButton').click(function (e) { e.preventDefault(); createModal.open(); });
  • If the modal still doesn’t open:

    • Confirm the modal pages exist and are routable: new abp.ModalManager(abp.appPath + 'Books/CreateModal'); new abp.ModalManager(abp.appPath + 'Books/EditModal'); Ensure Pages/Books/CreateModal.cshtml and EditModal.cshtml are present and the Razor page routes match (no folder/area mismatch).
    • Check permissions: the button is often wrapped with permission checks. Make sure the current user has BookStore.Books.Create.
  • Note on OS differences (Linux vs Windows):

    • File name case sensitivity: On Linux, file paths are case-sensitive. Ensure the script and page file names and paths referenced in code exactly match their casing on disk (e.g., Index.js vs index.js; Books/CreateModal vs books/createmodal).
  1. Sources
  • ABP GitHub issue/workaround that matches the undefined proxy namespace problem on generated MVC CRUD (fix by using window.myBookStore.books.book):
    • https://github.com/abpframework/abp
  • Repro repository you shared:
    • https://github.com/magentuseu/abp-tests

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.

  1. Solution
  • Why the markup looks different

    • You copied the free Account module’s Login.cshtml. However, you are using Account Pro Public Web (Volo.Abp.Account.Pro.Public.Web via the volo.abp.account.pro.public.web 9.0.2 package). The Pro Public Web module has different markup, partials, and styling hooks than the free module, so copying the free module’s page will visually regress the layout.
  • Get the correct, up-to-date view for Account Pro

    • Download the commercial module source code that matches your version, then copy the Login.cshtml from the Pro Public Web module as your starting point. ABP provides the theme/module source to commercial customers; use it to extract the exact Razor page used by your version so styles and structure remain intact.
    • Steps:
      1. Download commercial source packages for your licensed version (Account Pro + LeptonX/LeptonXLite if used).
      2. Locate the Razor page used by the login in Account Pro Public Web for your version. Path is typically under the module’s Pages/Account/Login.cshtml within Volo.Abp.Account.Pro.Public.Web.
      3. In your Auth Server project, create the override file at:
        • YourAuthServerProject/Pages/Account/Login.cshtml
      4. Copy the Pro Public Web Login.cshtml into your override.
      5. Ensure _ViewImports.cshtml includes ABP TagHelpers so the page compiles and renders correctly:
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
       @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
       @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
       @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
6) Keep the original model type from the Pro page (don’t switch to the free module’s LoginModel). If you need to extend behavior, subclass the correct Pro LoginModel type and only change the @model accordingly.
7) Now, minimally customize only the external login section:
   - Find the external login block:
     - The form with asp-page="./Login" asp-page-handler="ExternalLogin" (or a dedicated partial used for external providers).
   - Insert your small changes (e.g., button text, icon, order), leaving all other markup intact to preserve styling.
  • If you only want to inject buttons without copying the whole page

    • Best practice is still to start from the Pro Login.cshtml (so you are aligned with structure and CSS classes). Keep the file as-is and restrict edits to the external providers area.
    • If the Pro module renders external providers via a partial or a section, prefer overriding that partial only. Otherwise, keep the full page and make minimal edits.
  • LeptonX/LeptonXLite account layout note

    • The visual frame of the login typically comes from the theme’s Account layout. If your goal is only the external login area, don’t change the theme Account layout; keep using the Pro login page + your small edits.
  1. Sources
  • Validated: How to customize/override Razor Pages in ABP (explains the override mechanism and TagHelpers requirement):
    • https://abp.io/docs/latest/framework/ui/mvc-razor-pages/customization-user-interface
  • Validated: Example login page source for the free module (for comparison only; do not copy for Pro):
    • https://github.com/abpframework/abp/blob/dev/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml
  • Validated: Community thread confirming differences between Free vs Pro namespaces and customization via overriding:
    • https://abp.io/support/questions/2587
  • Validated: Community guidance on overriding account layouts/pages and ensuring _ViewImports when customizing:
    • https://abp.io/support/questions/6571

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.

  1. Solution Your test failure is thrown while ABP initializes the test application and runs your custom data seeding (NullReferenceException inside SiteManagementDataSeedContributor.SeedAsync). This typically happens in ABP tests when:
  • Seed contributors assume services or data that aren’t available in the test environment.
  • Seeding runs outside the proper tenant context.
  • Seeding touches EF Core or repositories before the DbContext is ready or within an unexpected transaction.

Apply the following steps to make your integration tests deterministic and fix the failure:

  • Guard your seed contributor against nulls and run inside a unit of work
public class SiteManagementDataSeedContributor : IDataSeedContributor, ITransientDependency
  {
      private readonly IUnitOfWorkManager _uowManager;
      private readonly IRepository<Contact, Guid> _contactRepository; // example
      private readonly ICurrentTenant _currentTenant;

      public SiteManagementDataSeedContributor(
          IUnitOfWorkManager uowManager,
          IRepository<Contact, Guid> contactRepository,
          ICurrentTenant currentTenant)
      {
          _uowManager = uowManager;
          _contactRepository = contactRepository;
          _currentTenant = currentTenant;
      }

      public async Task SeedAsync(DataSeedContext context)
      {
          // Avoid host-only seeding when you expect tenant-only data
          // and/or ensure you seed for a specific tenant
          using (_currentTenant.Change(context?.TenantId))
          {
              using (var uow = _uowManager.Begin(requiresNew: true))
              {
                  // Defensive checks to prevent NREs
                  if (_contactRepository == null)
                  {
                      await uow.CompleteAsync();
                      return;
                  }

                  // Example: skip if already seeded
                  var count = await _contactRepository.GetCountAsync();
                  if (count == 0)
                  {
                      await _contactRepository.InsertAsync(new Contact(/* init fields */), autoSave: true);
                      // ... add more seed data
                  }

                  await uow.CompleteAsync();
              }
          }
      }
  }
  • Ensure your test base module seeds within OnApplicationInitialization and inside a scope
public class SiteManagementTestBaseModule : AbpModule
  {
      public override void OnApplicationInitialization(ApplicationInitializationContext context)
      {
          SeedTestData(context);
      }

      private static void SeedTestData(ApplicationInitializationContext context)
      {
          AsyncHelper.RunSync(async () =>
          {
              using var scope = context.ServiceProvider.CreateScope();
              var dataSeeder = scope.ServiceProvider.GetRequiredService<IDataSeeder>();

              // Optionally seed for host or a specific test tenant
              await dataSeeder.SeedAsync(new DataSeedContext(/* tenantId: null or a tenant Guid */));
          });
      }
  }
  • If multi-tenancy is involved, make sure your tenant-scoped entities implement IMultiTenant If your Contacts (or any entity you seed/query in tests) are tenant-specific, the entity must implement IMultiTenant so ABP applies tenant filters and the correct connection (in database-per-tenant or split schemas) is used.
public class Contact : AggregateRoot<Guid>, IMultiTenant
  {
      public Guid? TenantId { get; set; }
      // other properties...
  }
  • Disable transactions in tests if you see transaction-related initialization errors Some providers/settings can cause issues with ambient transactions during seeding and initialization. In your EntityFrameworkCore test module, add:
public override void ConfigureServices(ServiceConfigurationContext context)
  {
      Configure<AbpUnitOfWorkDefaultOptions>(options =>
      {
          options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
      });

      context.Services.AddAlwaysDisableUnitOfWorkTransaction();

      Configure<FeatureManagementOptions>(options =>
      {
          options.SaveStaticFeaturesToDatabase = false;
          options.IsDynamicFeatureStoreEnabled = false;
      });
      Configure<PermissionManagementOptions>(options =>
      {
          options.SaveStaticPermissionsToDatabase = false;
          options.IsDynamicPermissionStoreEnabled = false;
      });
  }
  • Keep test seeding minimal and deterministic

    • Avoid external services or configuration that are not present in tests.
    • Use repositories only after Unit of Work is started.
    • Prefer idempotent seeding (check existence before insert).
  • If you need tenant data during test, explicitly seed for that tenant

var tenantId = /* known test tenant Guid */;
  await dataSeeder.SeedAsync(new DataSeedContext(tenantId));

These practices address:

  • The NullReferenceException by defensive coding and proper DI usage.
  • Ensuring the correct tenant context is used during seeding.
  • Avoiding transaction-related issues that can surface during test initialization.
  1. Sources
  • https://docs.abp.io/en/abp/latest/Testing
  • https://abp.io/support/questions/8896
  • https://abp.io/support/questions/6135

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.

Showing 1 to 10 of 708 entries
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 12, 2025, 10:36
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.