aspnetcore-401026-devextreme-based-controls-get-started-configure-a-visual-studio-project.md
Note
This tutorial applies exclusively to UI Controls. To get started with other controls, refer to the following help topics:
You can use a DevExtreme project template to create a new project or add DevExtreme to an existing project.
DevExtreme-based ASP.NET Core controls ship with the DevExtreme v25.2 ASP.NET Core Application project template. The template includes all server-side and client-side resources required for the controls, and configures the Data Grid control.
The steps below describe how to use this project template.
Click Create a new project on Visual Studio’s start page, select the DevExtreme v25.2 ASP.NET Core Application template, and click Next.
In the Configure your new project window, specify the project name and location, and click Create.
In the Create a new DevExtreme v25.2 ASP.NET Core Application window, specify project settings:
Click Create. Visual Studio creates a project with the Data Grid control. You can also add other controls to a project.
To configure an existing project to use DevExtreme-based controls, add DevExtreme resources to the project and set up a layout (complete project configuration).
Open your project in Visual Studio (see supported versions).
Right-click the project in the Solution Explorer window and select the Add DevExtreme to the Project command in the menu.
In the invoked dialog box, click OK.
Important
To complete project configuration, make sure that client-side resources are linked in the project. You can use the DevExtreme layout file where the resources are already linked or link the resources by yourself.
The DevExtreme layout file (_DevExtremeLayout.cshtml) is added to the project when you click the Add DevExtreme to the Project menu command. This file contains links to all the client-side resources.
To use this layout, go to the _ViewStart.cshtml file (located in the Pages or View/Shared folder) and change _Layout to _DevExtremeLayout.
@{
Layout = "_DevExtremeLayout";
}
Important
Use this approach if you add DevExtreme to a new ASP.NET Core project. If you have a customized project, link the resources in your project’s layout as described below.
Resources are usually linked in a project’s layout - the _Layout.cshtml file located in the Views/Shared folder (for MVC projects) or Pages folder (for Razor Pages).
Modify this file as follows:
Add the following CSS and script links to the <head> section:
If the layout file contains jQuery links that were added earlier (they may be placed in the <environment> containers), then remove them.
Note
You can also apply bundling and minification to static resources as described in the following article: Bundle and minify static assets in ASP.NET Core.
Your project can now use DevExtreme ASP.NET Core controls. Refer to Add Controls to a Project for more information.