Open Closed

Installing ABP Framework Manually #10577


User avatar
0
punta created

How to install ABP Framework (commercial) manually in asp.net mvc project step by step. I want to make use of the controller based approach not Razor for some corporate reasons.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

7 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • ABP Commercial (ABP Platform) is not designed to be installed into an arbitrary existing ASP.NET Core MVC project “piece by piece”. The supported, step-by-step manual way is to create an ABP Commercial solution with the ABP Startup Template (MVC + EF Core + SQL Server) and then move your MVC code into that solution (controllers/views/static files), or expose your existing code through ABP application services/modules.
    • If what you mean by “manual install” is “add commercial modules manually (without ABP CLI) into an ABP solution”, then you can do that by adding the relevant Volo.* NuGet packages and module dependencies (example below).

    Option A (Supported): Create an ABP Commercial MVC solution, then migrate your project into it

    1. Install ABP CLI (if not installed) and login (commercial feed access comes from your account/license).
    2. Create a new ABP MVC solution (EF Core + SQL Server):
    abp new MyCompany.MyProject --ui mvc --database-provider ef
    
    1. Configure SQL Server connection string in *.DbMigrator (and host/web if needed), then run the migrator to create DB + seed admin user.
    2. Copy/merge your existing MVC project assets into the ABP Web project:
      • Controllers (preferably convert business logic to Application Services and keep controllers thin)
      • Views / Pages
      • wwwroot, bundling/layout changes
    3. Re-implement auth/permissions using ABP’s authorization system (policies/permissions) and Identity/OpenIddict as needed.

    Option B: “Manual installation” of a Commercial module (pattern) inside an ABP MVC solution

    If you already have an ABP MVC solution and want to add a commercial module manually (without abp add-module), the general steps are:

    1. Add the module NuGet package(s) to the correct layer(s) (Application / Domain / EFCore / Web, etc.)
    2. Add the module class to the DependsOn(...) attribute of your module classes.
    3. If the module has EF Core integration, call its builder.ConfigureXxx() inside your DbContext.OnModelCreating.
    4. Add the module’s NPM package (if it has an MVC UI) and run library install.

    Example (from the official “File Management Module (Pro) – Manual Installation” approach):

    1. Add package reference (example: to *.Application.csproj):
    <PackageReference Include="Volo.FileManagement.Application" Version="x.x.x" />
    
    1. Add dependency in your module class (example: *.ApplicationModule):
    [DependsOn(
        // ...
        typeof(FileManagementApplicationModule)
    )]
    public class MyProjectApplicationModule : AbpModule
    {
    }
    
    1. EF Core model configuration in your DbContext:
    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);
    
        builder.ConfigureFileManagement();
    }
    
    1. Add NPM package to package.json (Web project):
    "dependencies": {
      "@volo/file-management": "^2.9.0"
    }
    
    1. Then run (in the Web project folder):
    abp install-libs
    

    Sources

    • https://abp.io/docs/latest/CLI
    • https://abp.io/docs/10.2/modules/file-management

    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    punta created

    We choose to install ABP manually because our dynamic page content generator is designed to follow the controller based approach. Let me redefine the problem. Question: How to convert abp framework razor page application into controller based mvc app step by step

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • In ABP, MVC Controllers + Views and Razor Pages are both hosted by the same ASP.NET Core MVC stack. There isn’t a “switch” that automatically converts a Razor Pages UI into controller-based MVC UI. The conversion is essentially: stop creating/using Pages/*.cshtml endpoints and implement the same endpoints as Controllers/*Controller.cs + Views/*/*.cshtml (while keeping ABP’s theme/bundling/layout infrastructure).
    • Below is a practical, step-by-step conversion approach that keeps ABP Commercial and moves your UI to controller-based MVC.

    1) Keep ABP as-is; just stop using Razor Pages routes

    1. Leave all ABP modules, authentication (AuthServer/OpenIddict), localization, theming, etc. intact.

    2. For each UI feature currently implemented as Razor Pages:

      • Pages/Foo/Index.cshtml (+ Index.cshtml.cs)
      • Pages/Foo/Create.cshtml (+ Create.cshtml.cs)
      • Pages/Foo/Edit.cshtml (+ Edit.cshtml.cs)

      You will create:

      • Controllers/FooController.cs
      • Views/Foo/Index.cshtml
      • Views/Foo/Create.cshtml
      • Views/Foo/Edit.cshtml
    3. Once the controller routes work, you can delete (or ignore) the old Razor Pages under Pages/ to avoid duplicate endpoints.


    2) Convert each Razor PageModel into an MVC Controller action

    Example mapping

    Razor Page

    • URL: /Books
    • Files: Pages/Books/Index.cshtml and Pages/Books/Index.cshtml.cs

    MVC

    • URL: /Books
    • Files: Controllers/BooksController.cs and Views/Books/Index.cshtml

    Controller skeleton (ABP-style)

    using Microsoft.AspNetCore.Mvc;
    using Volo.Abp.AspNetCore.Mvc;
    
    namespace MyCompany.MyProject.Web.Controllers;
    
    [Route("[controller]")]
    public class BooksController : AbpController
    {
        [HttpGet]
        [Route("")]
        public IActionResult Index()
        {
            return View();
        }
    
        [HttpGet]
        [Route("Create")]
        public IActionResult Create()
        {
            return View();
        }
    }
    

    Key ABP point: keep your business logic in Application Services (e.g., IBookAppService). Your controller should call application services and pass view models to views.


    3) Replace asp-page usages with MVC equivalents

    In ABP Razor Pages UIs, you often see:

    • asp-page="/Books/CreateModal"
    • Url.Page(...)

    When you move to controllers:

    • Use asp-controller="Books" asp-action="Create" or Url.Action(...).

    Example:

    <a class="btn btn-primary" asp-controller="Books" asp-action="Create">New Book</a>
    

    4) If your UI currently uses “Create/Edit modal” Razor Pages, convert to full pages (or keep modal behavior)

    ABP templates commonly use “CreateModal / EditModal” Razor Pages (opened via JS modal manager). If you want controller-based pages, a proven approach is to turn those modals into normal pages (and then you can further convert to controllers if you want).

    A community article shows exactly how to convert ABP modal pages into regular pages by:

    • changing links/actions to navigate with URL
    • removing modal-manager JS parts
    • wrapping the modal markup so it renders as a page

    (Use the technique/pattern, then you can translate the endpoint from Razor Page to MVC Controller.)

    This reference includes a working commit you can follow.


    5) Keep ABP theme/layout/bundling; just render Views instead of Pages

    Even when you move to controllers+views, ABP’s theming/bundling still applies.

    • Your views should continue to use the same shared layouts (Basic/LeptonX) unless you override them.
    • You can override theme layouts by copying the layout file into your project using the same virtual path (ABP VFS override mechanism). This is the standard way to apply a corporate HTML theme.

    (You’ll typically override Themes/.../Layouts/... and configure AbpBundlingOptions to add your CSS/JS.)


    6) Validate routing and remove Razor Pages endpoints

    Once your controller routes are ready:

    • Remove the corresponding Pages/... files, or at least ensure you’re not linking to them anymore.
    • Test that navigation, authorization, localization, and static resources still work.

    (light) verified references

    • https://abp.io/docs/latest/framework/ui/mvc-razor-pages/theming
    • https://abp.io/community/articles/4ps5v60m
    • https://github.com/abpframework/abp-samples/commit/f3014e0ec422cb2d8816d0e00dd6ab9cc1adfc21

    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    punta created

    What about changing the pipeline to use controllers and views instead?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • You generally don’t need to change the ASP.NET Core pipeline to “use controllers/views instead of Razor Pages” in ABP. ABP MVC UI already runs on the same MVC infrastructure; Razor Pages are just additional endpoints.
    • What you do in practice is:
      1. Ensure MVC controllers + views are enabled.
      2. Stop mapping Razor Pages endpoints (or just don’t create any Razor Pages routes/content), then route everything through controllers.

    1) Configure endpoints to map controllers (and optionally stop mapping Razor Pages)

    In your Web project Program.cs (or the equivalent in your ABP host), ensure you have endpoint routing and map controller routes:

    app.UseRouting();
    
    app.UseAuthentication();
    app.UseAuthorization();
    
    app.UseConfiguredEndpoints(endpoints =>
    {
        endpoints.MapControllerRoute(
            name: "default",
            pattern: "{controller=Home}/{action=Index}/{id?}");
    
        // If you want to prevent Razor Pages endpoints from being reachable,
        // do NOT map Razor Pages:
        // endpoints.MapRazorPages();
    });
    

    If your solution currently maps Razor Pages somewhere (some templates do), removing MapRazorPages() will stop Razor Page endpoints from being matched.

    2) Ensure MVC controllers are discovered (ABP conventional controllers – optional but common)

    If you want ABP to automatically expose your Application Services as HTTP APIs (common when building controller/view UIs that call backend APIs), make sure conventional controllers are enabled:

    Configure<AbpAspNetCoreMvcOptions>(options =>
    {
        options.ConventionalControllers.Create(typeof(MyProjectApplicationModule).Assembly);
    });
    

    This is especially relevant in “public web” style setups where proxies/controllers may not be created by default.

    3) Move/implement UI routes as controllers + views

    Once the endpoints are mapped, the rest of the “conversion” is purely at the feature level:

    • Replace Pages/... Razor Pages with Controllers/...Controller.cs
    • Create Views/.../*.cshtml
    • Update links from asp-page="..." to asp-controller / asp-action

    (light) verified references

    • https://abp.io/docs/latest/framework/ui/mvc-razor-pages/theming
    • https://abp.io/docs/latest/release-info/migration-guides/abp-5-2
    • https://abp.io/support/questions/959

    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    punta created

    Where to enable ABP conventional controllers?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • Enable ABP Conventional Controllers in your Web/HttpApi.Host module (i.e., the module that hosts ASP.NET Core MVC) by configuring AbpAspNetCoreMvcOptions and calling options.ConventionalControllers.Create(...).
    • The most common place is the PreConfigureServices method of your *.WebModule (or *.HttpApiHostModule).
    using Volo.Abp.AspNetCore.Mvc;
    using Volo.Abp.Modularity;
    
    [DependsOn(typeof(MyProjectApplicationModule))]
    public class MyProjectWebModule : AbpModule
    {
        public override void PreConfigureServices(ServiceConfigurationContext context)
        {
            PreConfigure<AbpAspNetCoreMvcOptions>(options =>
            {
                options.ConventionalControllers.Create(typeof(MyProjectApplicationModule).Assembly);
            });
        }
    }
    

    Notes:

    • Use the Application assembly (where your AppServices are) in Create(...) so ABP can generate API controllers for those application services.

    • If you’re in a tiered solution, you typically put this in HttpApi.Host (not the MVC UI project), because that’s where the APIs are exposed.

    • https://abp.io/docs/latest/framework/api-development/auto-controllers


    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
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.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.