Using Agility CMS with ASP.NET Core


We are pleased to announce that Agility.Web for ASP.NET Core is now available on

Install-Package Agility.AspNetCore -Version

There are minimal structural changes in how things work in comparison to ASP.NET MVC.

Instance-Specific Agility Configuration

What used to be Web.config in a traditional ASP.NET MVC app is now replaced with appsettings.json in ASP.NET Core and it will look like the following for agility configuration:

  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Warning"
  "Agility": {
    "applicationName": "Sample Website (Local)",
    "websiteName": "Sample Website",
    "securityKey": "your instance's security code",
    "contentCacheFilePath": "/home/AgilityContent/",
    "contentServerUrl": "",
    "developmentMode": "false",
    "Trace": {
      "traceLevel": "Verbose",
      "logFilePath": "/home/AgilityLogs/AgilityWebsite.log"
    "UGC": {
      "Url": "",
      "Key": "your ugc key",
      "Password": "your ugc password"


Registering Agility Routes

Default Agility Routes for the Page Tree are registered in Configure method of ASP.NET Core projects Startup.cs file as follows:

app.UseMvc(routes =>
    //Agility Builtin Route
    routes.MapRoute("Agility", "{*sitemapPath}", new { controller = "Agility", action = "RenderPage" },
        new { isAgilityPath = new Agility.Web.Mvc.AgilityRouteConstraint() });

        name: "default",
        template: "{controller=Home}/{action=Index}/{id?}");

Module Setup with ViewComponents

In a traditional ASP.NET MVC project, Controllers and Actions are used to render Agility Modules. ASP.NET Core replaces them with ViewComponents. Using ViewComponents enables Agility.Web for ASP.NET Core to render modules on a page asynchronously.

The above code snippet would look like the following snippet in an ASP.NET MVC project.

0 out of 0 found this helpful



Please sign in to leave a comment.