aspnetcore-401027-devextreme-based-controls-get-started-configure-a-non-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 develop your ASP.NET Core application without Visual Studio, for example, on MacOS, Linux, using Visual Studio Code or CLI tools.
To configure your project to use DevExtreme-based controls, follow the steps below.
Open the console and navigate to your project’s directory:
Obtain your NuGet feed URL. Then, follow one of the installation tutorials:
Install the DevExtreme.AspNet.Data and DevExtreme.AspNet.Core packages for your project:
The instructions below describe how to use npm and LibMan CLI to add client-side resources (DevExtreme scripts and CSS files) to a project.
Note
You can also use Webpack or Gulp to add client-side resources.
Ensure that Node.js is installed.
Open the console from the project directory and run the following commands to install DevExtreme and DevExtreme AspNet Data:
Run the following command to initialize LibMan in your project:
Add library files listed below to the libman.json file. You can modify this file or use the libman install command.
Run the following command to restore library files:
Open your project’s layout. Typically, it is the _Layout.cshtml file located in the Views/Shared folder (for MVC projects) or Pages folder (for Razor Pages).
Link the following styles and scripts in the head section:
The layout file can contain jQuery links that were added earlier (they may be placed in the <environment> containers). In this case, 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.
Open the _ViewImports.cshtml file located in the Views/Shared folder or Pages folder and add the following directive to it:
@using DevExtreme.AspNet.Mvc
Add the following code to ensure proper JSON serialization:
builder.Services.AddRazorPages().AddJsonOptions(options => options.JsonSerializerOptions.PropertyNamingPolicy = null);
For Razor page projects, enable controllers at the top level of the application:
app.MapControllers();
app.MapDefaultControllerRoute();