unable to resolve service for type kendo.mvc.rendering.kendo html generator

1 Answer 492 Views
Grid
Cesar
Top achievements
Rank 2
Cesar asked on 23 Aug 2021, 01:30 AM

In my project asp .Net 5.0 Core, I have the next problem when my page load.

unable to resolve service for type 'kendo.mvc.rendering.kendo html generator'

  • Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)

  • lambda_method29(Closure , IServiceProvider , object[] )

  • Microsoft.AspNetCore.Mvc.Infrastructure.TypeActivatorCache.CreateInstance<TInstance>(IServiceProvider serviceProvider, Type implementationType)

  • Microsoft.AspNetCore.Mvc.Razor.Infrastructure.DefaultTagHelperActivator.Create<TTagHelper>(ViewContext context)

  • Microsoft.AspNetCore.Mvc.Razor.DefaultTagHelperFactory.CreateTagHelper<TTagHelper>(ViewContext context)

  • Microsoft.AspNetCore.Mvc.Razor.RazorPageBase.CreateTagHelper<TTagHelper>()

  • AspNetCore.Views_AlmacenProductosServicios_Index.ExecuteAsync() in Index.cshtml

    1. ViewData["Title"] = "Listado de productos y servicios";
  • Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)

  • Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts)

  • Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)

  • Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode)

  • Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode)

  • Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, string contentType, Nullable<int> statusCode)

  • Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)

  • Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted)

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()

  • Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)

  • Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)

  • Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)

  • Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

 

I used the telerik package telerik.ui.for.aspnet.core.2021.2.616

In _ViewImports

@using WASys

@using WASys.Models

@using Kendo.Mvc.UI

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

@addTagHelper *, Kendo.Mvc

My Page

 

<kendo-grid name="grid" height="550">

  <columns>

    <column field="ID" title="Order ID">

      <filterable enabled="false"></filterable>

    </column>

    <column field="CodigoInterno" title="Codigo" />

    <column field="NombreLargo" title="Nombre Producto/Servicio" />

    <column field="PrecioCosto" title="Precio Costo" />

  </columns>

  <scrollable enabled="true" />

  <sortable enabled="true" />

  <pageable enabled="true" />

  <filterable enabled="true" />

  <datasource type="DataSourceTagHelperType.Ajax" page-size="20">

    <transport>

      <read url="@Url.Action("Orders_Read", "AlmacenProductosServicios")" />

    </transport>

  </datasource>

</kendo-grid>

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 25 Aug 2021, 04:58 PM

Hi Cesar,

Thank you for the shared screenshots.

Would you please ensure that the Kendo UI services are added to the ConfigureServices method in the "Startup.cs" file ( it is highlighted in yellow below)?

//Startup.cs file

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
            // Add framework services.
            services
                .AddControllersWithViews()
                // Maintain property names during serialization. See:
                // https://github.com/aspnet/Announcements/issues/194
                .AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());

            // Add Kendo UI services to the services container
            services.AddKendo();
}

 

 

Regards, Mihaela Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Cesar
Top achievements
Rank 2
Answers by
Mihaela
Telerik team
Share this question
or