Back to Devexpress

Configure a Visual Studio Project

aspnetcore-400374-spreadsheet-configure-a-visual-studio-project.md

latest1.4 KB
Original Source

Configure a Visual Studio Project

  • Sep 09, 2024
  • 2 minutes to read

Install Required Packages

Perform the following steps to install the Spreadsheet control’s NuGet packages:

  1. Right-click the Dependencies node in the Solution Explorer and select Manage NuGet Packages in the invoked context menu.

  2. Select DevExpress 25.2 Local in the Package source drop-down list and go to the Browse page. Locate the DevExpress.AspNetCore.Spreadsheet package and install it.

Configure the Project

  1. Right-click the application’s name in the Solution Explorer and select Add | Add New Item. In the invoked Add New Item dialog, select the Installed | Visual C# | ASP.NET Core | Web category and the npm Configuration File item template. Click Add.

  2. Right-click the package.json file and select Restore Packages. This adds the node_modules directory to the application folder.

  3. Add the following code to the Program.cs file to configure the application, so that it can serve the node_modules directory’s files:

Register Static Resources

  1. In the _ViewImports.cshtml file, import the DevExpress.AspNetCore namespace that all views in the project should use.

  2. Create or open an existing view (for example, the Index.cshtml file), and register the resources in the header section as shown below.