ASP.NET Core Blazor [Preview]
Search results

Getting Started with Essential JS 2 for Blazor in .NET Core CLI

This article provides a step-by-step introduction to configure Essential JS 2 setup, build and publish a simple .NET Core Blazor web application using the .Net Core CLI.

Blazor is an unsupported, experimental web framework that shouldn’t be used for production workloads at this time.


The official prerequisites to create and run the Blazor on Windows environment are described in the .NET Core Blazor documentation website.

Create a Blazor in .NET Core CLI

  1. Add blazor project template using below command.

    dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview4-19216-03
  1. Once project template installed run the following command to create blazor template.

        dotnet new blazor -o WebApplication1
        cd WebApplication1

Importing Essential JS 2 Razor components in the application

  1. Now, add the Syncfusion.EJ2.AspNet.Core.RazorComponents NuGet package to the new application using below command

        dotnet add package Syncfusion.EJ2.AspNet.Core.RazorComponents
        dotnet restore
  2. The Essential JS 2 package will be included in the project, after the installation process is completed.

  3. Open ~/_Imports.razor file and import the Syncfusion.EJ2.RazorComponents.

    @using Syncfusion.EJ2.RazorComponents
    @using Syncfusion.EJ2.RazorComponents.Calendars
  4. Add the client-side resources through CDN or local npm package in the <head> element of the ~/wwwroot/index.html page.

    <environment include="Development">
        <link href="" rel="stylesheet" />
        <script src=""></script>
        <script src=""></script>

import cdn

  1. Now, add the Syncfusion Essential JS 2 components in any web page (razor) in the Pages folder. For example, the calendar component is added in the ~/Pages/Index.razor page.

    <EjsCalendar ID="test"></EjsCalendar>
  2. Run dotnet run command to run the application. The Essential JS 2 calendar component will render in the web browser.