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.
7 Answer(s)
-
0
- 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
- Install ABP CLI (if not installed) and login (commercial feed access comes from your account/license).
- Create a new ABP MVC solution (EF Core + SQL Server):
abp new MyCompany.MyProject --ui mvc --database-provider ef- Configure SQL Server connection string in
*.DbMigrator(and host/web if needed), then run the migrator to create DB + seed admin user. - 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
- 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:- Add the module NuGet package(s) to the correct layer(s) (Application / Domain / EFCore / Web, etc.)
- Add the module class to the
DependsOn(...)attribute of your module classes. - If the module has EF Core integration, call its
builder.ConfigureXxx()inside yourDbContext.OnModelCreating. - 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):
- Add package reference (example: to
*.Application.csproj):
<PackageReference Include="Volo.FileManagement.Application" Version="x.x.x" />- Add dependency in your module class (example:
*.ApplicationModule):
[DependsOn( // ... typeof(FileManagementApplicationModule) )] public class MyProjectApplicationModule : AbpModule { }- EF Core model configuration in your
DbContext:
protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); builder.ConfigureFileManagement(); }- Add NPM package to
package.json(Web project):
"dependencies": { "@volo/file-management": "^2.9.0" }- 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) -
0
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) -
0
- 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/*.cshtmlendpoints and implement the same endpoints asControllers/*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
Leave all ABP modules, authentication (AuthServer/OpenIddict), localization, theming, etc. intact.
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.csViews/Foo/Index.cshtmlViews/Foo/Create.cshtmlViews/Foo/Edit.cshtml
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.cshtmlandPages/Books/Index.cshtml.cs
MVC
- URL:
/Books - Files:
Controllers/BooksController.csandViews/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-pageusages with MVC equivalentsIn 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"orUrl.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 configureAbpBundlingOptionsto 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) - 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
-
0
- 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:
- Ensure MVC controllers + views are enabled.
- 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 withControllers/...Controller.cs - Create
Views/.../*.cshtml - Update links from
asp-page="..."toasp-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) -
0
- Enable ABP Conventional Controllers in your Web/HttpApi.Host module (i.e., the module that hosts ASP.NET Core MVC) by configuring
AbpAspNetCoreMvcOptionsand callingoptions.ConventionalControllers.Create(...). - The most common place is the
PreConfigureServicesmethod 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) - Enable ABP Conventional Controllers in your Web/HttpApi.Host module (i.e., the module that hosts ASP.NET Core MVC) by configuring