---
title: "Sitecore ASP.NET Core SDK"
slug: "sitecore-asp-net-core-sdk"
abstract: "Easily integrate SitecoreAI into your front-end web apps built with ASP.NET Core."
---
# Sitecore ASP.NET Core SDK

The [open-source ASP.NET Core SDK](https://github.com/Sitecore/ASP.NET-Core-SDK) lets developers integrate SitecoreAI content or Sitecore XM/XP content into their ASP.NET Core applications.

> [!note]
> Although this documentation describes using the ASP.NET Core SDK to integrate SitecoreAI content, you can also use the SDK functionality to integrate XM/XP content.

The ASP.NET Core SDK connects front-end web apps[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f8d0d2b9c] built with ASP.NET Core to SitecoreAI[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f8e673856]. The SDK retrieves layout data[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c5d012f23a5] in JSON format, which is then used to display SitecoreAI content to the app's visitors. This means that the web app uses Sitecore as a headless content management system (CMS). For more information, see [Architecture](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/asp-net-core-sdk-architecture.html "ASP.NET Core SDK architecture").

> [!note]
> If you don't have an ASP.NET Core app, create one based on the [XM Cloud ASP.NET Core starter kit](https://github.com/Sitecore/xmcloud-starter-dotnet).
>
> To render Sitecore content in JavaScript or TypeScript web apps instead, use the [Sitecore JavaScript Rendering SDK (JSS)](https://doc.sitecore.com/document/preview/1453888#UUID-fa3dcb81-abf2-bc3c-626a-9033f985e4f0).Introducing Sitecore JavaScript Services SDK

> [!note]
> **XM Cloud is now SitecoreAI**
> Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

## Development tasks with the ASP.NET Core SDK

The most common development task you'll perform with the ASP.NET Core SDK is to build [model-bound views with a Sitecore data source](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/model-bound-views.html "Model-bound views"). In this task, you build templates in the Content Editor for a Sitecore data source, then use the ASP.NET Core SDK to build views and models to render those templates. These views then render SitecoreAI content to your site visitors.

Other development tasks you can perform with the ASP.NET Core SDK include:

- Build [view components](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/view-components.html "View components") - use view components to render custom logic where you access third-party data sources.
- Build [partial views](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/partial-views.html "Partial views") - use partial views for lightweight components on a Sitecore page that don't contain their own content, such as structural components that only contain placeholders.
- Generate a sitemap.
- Configure redirects.
- Configure localization and content translation, and build a language switcher.

## Deployment options

ASP.NET Core apps built with the ASP.NET Core SDK cannot be deployed directly inside SitecoreAI. Instead, you must deploy your ASP.NET Core application to your preferred hosting provider, such as Azure App Service. Then, [configure an external editing host](https://doc.sitecore.com/document/preview/826789#UUID-3e0f35aa-c466-f6de-3ffb-001be513d086) to ensure that SitecoreAI uses your hosted application for content editing experiences.Configure an external editing host

## When to choose the ASP.NET Core SDK

The ASP.NET Core SDK is for development teams who want to build ASP.NET Core web applications and have working knowledge of C# and the [Model-View-Controller (MVC) architectural pattern](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview?view=aspnetcore-8.0). Knowledge of Razor views, tag helpers, and [content modeling in SitecoreAI](https://doc.sitecore.com/document/preview/1454708#UUID-87c4543b-611c-b7d7-0fcf-427c25571226) is an advantage.Content modeling and presentation

We recommend that development teams who want to build single-page applications (SPA) or have working knowledge of JavaScript or TypeScript use the [Sitecore JavaScript Rendering SDK (JSS)](https://doc.sitecore.com/document/preview/1453888#UUID-fa3dcb81-abf2-bc3c-626a-9033f985e4f0) instead.Introducing Sitecore JavaScript Services SDK

## Benefits of the ASP.NET Core SDK

The ASP.NET Core SDK greatly simplifies developing ASP.NET Core apps connected to SitecoreAI. For example, the SDK:

- Works seamlessly with the ASP.NET Core framework: it supports [model binding](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/model-binding.html "Model binding"), view components, partial views, Razor views, service registration, and middleware.
- Simplifies deserializing the complex, often deeply nested layout data.
- Contains [tag helpers](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/tag-helpers.html "Tag helpers") for rendering Sitecore fields.
- Contains middleware that maps incoming HTTP requests to Sitecore Experience Edge[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c87126a7364] requests.
- Includes hot reloading, which enables faster debugging and iteration cycles.

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f8d0d2b9c]: A *front-end web app*, previously known as a rendering host or rendering app, is a web-based application that displays content to site visitors. The content, or layout data, is retrieved from SitecoreAI that the app connects to using a Sitecore SDK, such as the ASP.NET Core SDK.
    
    The front-end web app does more than just render content: it also handles user requests, routing, data fetching, and other Sitecore digital experience platform (DXP) capabilities.

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f8e673856]: *SitecoreAI* is a SaaS CMS that delivers layout data in JSON format to front-end applications.

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c5d012f23a5]: *Layout data* is a JSON object that represents the structure of a page or a component in Sitecore. The layout data is used to display the page in a front-end application. The ASP.NET Core SDK uses GraphQL to retrieve layout data.

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c87126a7364]: *Experience Edge* is a service where SitecoreAI content, such as webpages, site layout, navigation, and other elements, are published. Experience Edge delivers this content to various channels, such as web apps, mobile apps, airport check-in kiosks, email, SMS, wearables, AI-enabled voice assistants, VR headsets, IoT devices, and more.
