We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Syncfusion.EJ2.Blazor 17.4.0.39

Hi.After installing the package Nuget "Syncfusion.EJ2.Blazor 17.4.0.39" an error has occurred:
InvalidOperationException: Cannot provide a value for property 'SyncfusionService' on type 'Syncfusion.EJ2.Blazor.Grids.EjsGrid`1[[PTS.Models.Movie, PTS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'. There is no registered service of type 'Syncfusion.EJ2.Blazor.SyncfusionBlazorService'.

I use Custom DataAdaptor:

    // Implementing custom adaptor by extending the DataAdaptor class
    public class MovieAdaptor : DataAdaptor
    {
        readonly ApplicationDbContext db;
        private readonly IMapper mapper;

....

3 Replies

MA Matthew December 18, 2019 10:19 AM UTC

Hi Costa,

For the latest version, we need to add syncfusion blazor as a service in our startup.cs

Add the following using statement near the top of startup.cs

using Syncfusion.EJ2.Blazor;


Then in the ConfigureServices method add the following

services.AddSyncfusionBlazor();

Please can a Syncfusion dev confirm this -- I have done it and got it working, but still would be nice to have an official word.
Also, please can Syncfusion update the Getting Started documentation for Blazor to include this information.

HTH



CO Costa December 18, 2019 11:08 AM UTC

Thank you, Matthew. The solution works.


VN Vignesh Natarajan Syncfusion Team December 18, 2019 11:27 AM UTC

Hi Matthew / Costa, 

Thanks for contacting Syncfusion support.  

Query: “Please can a Syncfusion dev confirm this -- I have done it and got it working, but still would be nice to have an official word. 
 
Yes, from our latest release 2019 Volume 4 ( 17.4.0.39), we need to include the below highlighted line to ignore the Syncfusion service reference error while using the Syncfusion Products. 

Refer the below code example.   

[startup.cs] 

  public void ConfigureServices(IServiceCollection services) 
        { 
            services.AddRazorPages(); 
            services.AddServerSideBlazor(); 
            services.AddSingleton<WeatherForecastService>(); 
            services.AddSyncfusionBlazor(); 
       } 

Refer our UG documentation for your reference 



Please get back to us if you have further queries.  

Regards, 
Vignesh Natarajan.  


Loader.
Live Chat Icon For mobile
Up arrow icon