---
title: Configuring the Core application
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** This page is a part of a tutorial, which you should follow sequentially from beginning to end. [Go to the first page: Using the Xperience interface](https://docs.kentico.com/13tutorial/using-the-xperience-interface.md).

In the [previous step](https://docs.kentico.com/13tutorial/developer-tutorial/asp-net-core-development-tutorial/setting-up-an-xperience-core-project.md) of this tutorial, we've installed the Xperience instance that will serve as your site's content repository and the associated ASP.NET Core application that will be used to present your tutorial website. We've also set up a hosting and development environment for the Core application using IIS Express.

Now, we'll configure the Core application by enabling Xperience's content tree-based routing and page builder features. In Xperience, some features provided by the system need to be explicitly enabled on the side of the [front-end](https://docs.kentico.com/13/developing-websites/developing-xperience-applications-using-asp-net-core.md) ASP.NET Core application. This allows you to enable and configure only the features you end up using.

With _content tree-based routing_, the system automatically generates and matches page URLs based on their position in the website's content tree (demonstrated further in the tutorial). You do not need to perform any manual route mapping and configuration in the Core application. All routing logic is handled for you by Xperience. We'll set up the pages on our tutorial website using this approach.

The _page builder feature_ enables non-technical users to manage page content via an intuitive drag-and-drop interface. When using the page builder, content editors work with widgets – predefined, configurable pieces of content represented by a partial view or a view component. Fully setting up the page builder is a multistep process that we'll gradually go through during this tutorial.

## Configuring the Core project

1. Open the **MEDIOClinic.sln** solution in Visual Studio.
   - The solution is located in the path set by the **Target location** option during the installation process: _C:\inetpub\wwwroot\Xperience13_
2. Open the Core application's **Startup.cs** file.
   - The default ASP.NET Core application template provided by the installer contains a middleware pipeline preconfigured to run Xperience projects.
3. Add all **using** statements listed in the code example below.
4. In the **ConfigureServices** method, uncomment the **features.UsePageBuilder()** and **features.UsePageRouting()** lines. This enables the _page builder_ and _content tree-based_ routing features. We'll use both in the following parts of this tutorial. The **ConfigureServices** method should now look like this:

   ```csharp

   using Kentico.Web.Mvc;
   using Kentico.Content.Web.Mvc;
   using Kentico.Content.Web.Mvc.Routing;
   using Kentico.PageBuilder.Web.Mvc;

   using Microsoft.AspNetCore.Builder;
   using Microsoft.AspNetCore.Hosting;
   using Microsoft.AspNetCore.Http;
   using Microsoft.Extensions.DependencyInjection;
   using Microsoft.Extensions.Hosting;
   ...

   public void ConfigureServices(IServiceCollection services)
   {
       // Enable desired Kentico Xperience features
       var kenticoServiceCollection = services.AddKentico(features =>
       {
           features.UsePageBuilder();
           // features.UseActivityTracking();
           // features.UseABTesting();
           // features.UseWebAnalytics();
           // features.UseEmailTracking();
           // features.UseCampaignLogger();
           // features.UseScheduler();
           features.UsePageRouting();
       });

       if (Environment.IsDevelopment())
       {
           // By default, Xperience sends cookies using SameSite=Lax. If the administration and live site applications
           // are hosted on separate domains, this ensures cookies are set with SameSite=None and Secure. The configuration
           // only applies when communicating with the Xperience administration via preview links. Both applications also need 
           // to use a secure connection (HTTPS) to ensure cookies are not rejected by the client.
           kenticoServiceCollection.SetAdminCookiesSameSiteNone();

           // By default, Xperience requires a secure connection (HTTPS) if administration and live site applications
           // are hosted on separate domains. This configuration simplifies the initial setup of the development
           // or evaluation environment without the need for secure connection. The system ignores authentication
           // cookies and this information is taken from the URL.
           kenticoServiceCollection.DisableVirtualContextSecurityForLocalhost();
       }

       services.AddAuthentication();
       services.AddControllersWithViews();
   }

   ```
5. **Rebuild** the _MEDIOClinic_ solution.

You are all set! Your Core application is now configured, and you can start modeling your site's pages in the next step.

At this point, the live site will only display a "The site has not been configured yet." message. Don't worry about this for now, you will create the site's layout and implement content functionality later in the tutorial.

**Previous page:** [Setting up an Xperience Core project](https://docs.kentico.com/13tutorial/developer-tutorial/asp-net-core-development-tutorial/setting-up-an-xperience-core-project.md) — **Next page:** [Modeling content](https://docs.kentico.com/13tutorial/developer-tutorial/asp-net-core-development-tutorial/modeling-content.md)

**Completed pages:** 3 of 10
