Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache'

14 posts, 0 answers
  1. Jerry
    Jerry avatar
    3 posts
    Member since:
    Oct 2019

    Posted 24 Oct 2019 Link to this post

    Hi all,

    Is anyone else seeing the error below?  I get it at runtime when CreateHostBuilder(args).Build().Run() is called.

     

    System.AggregateException
      HResult=0x80131500
      Message=Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Kendo.Mvc.Rendering.IKendoHtmlGenerator Lifetime: Transient ImplementationType: Kendo.Mvc.Rendering.KendoHtmlGenerator': Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.)
      Source=Microsoft.Extensions.DependencyInjection
      StackTrace:
       at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, ServiceProviderOptions options)
       at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options)
       at Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory.CreateServiceProvider(IServiceCollection containerBuilder)
       at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder)
       at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
       at Microsoft.Extensions.Hosting.HostBuilder.Build()
       at GariboldiApp.Program.Main(String[] args) in D:\Project Consultants\JV\git_work\Garibaldi\Gariboldi\GariboldiApp\Program.cs:line 16

    Inner Exception 1:
    InvalidOperationException: Error while validating the service descriptor 'ServiceType: Kendo.Mvc.Rendering.IKendoHtmlGenerator Lifetime: Transient ImplementationType: Kendo.Mvc.Rendering.KendoHtmlGenerator': Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

    Inner Exception 2:
    TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

     

    Many thanks!

    Jerry Tennison


  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1237 posts

    Posted 29 Oct 2019 Link to this post

    Hi Jerry,

    I am afraid that we are not aware of an issue as the observed. Therefore, I would like to ask you to prepare and send us a small isolated runnable sample revealing the error observed. Please, remove any external dependencies from that and database calls (if any). Also remove any controllers, views, and models, which are not related to the problem. If you prefer to keep the sample project confidential, I would recommend you to open a support ticket on the same topic and upload the demo there.

    Regards,
    Veselin Tsvetanov
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Jerry
    Jerry avatar
    3 posts
    Member since:
    Oct 2019

    Posted 29 Oct 2019 Link to this post

    Hi Veselin,

    I posted a complete Visual Studio solution with this ticket.  It builds, but it does not run.

    Since I created the ticket, I have uninstalled and re-installed Visual Studio multiple times.  One thing that appears to be consistent is that the Azure workload must be installed with Visual Studio in order for a demo web app to work properly.  I do not remember seeing that anywhere in the required prerequisites, so it might be worthwhile for you guys to look into what is coming from the Azure workload that the Kendo UI components depend on.

    Best regards,

    Jerry Tennison

  4. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1237 posts

    Posted 31 Oct 2019 Link to this post

    Hello Jerry,

    The Azure workload should not be required when running applications featuring Telerik UI for ASP.NET Core components. May I ask you to specify which demo application results in the above requirement?

    As per the error, you have initially opened the current thread for, that would be present when using an older version of Telerik UI for ASP.NET Core within a .Net Core 3.0 application. In order to avoid that you should make sure that the version of the Telerik package is the latest (2019.3.1023).

    I have also reviewed the support thread that you have opened on the same. Here is what I believe went wrong with the Telerik version. I noticed that your initial project references version 2018.3.911 of Telerik.UI.for.AspNet.Core.Trial package. That is the only version of the above package available on the public NuGet.org feed. I believe that you have included a reference from that source, instead of the latest trial available on the Telerik private NuGet feed. Here you will find some more info on how to set up the Telerik NuGet:

    https://docs.telerik.com/aspnet-core/getting-started/installation/nuget-install

    Regards,
    Veselin Tsvetanov
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Artem
    Artem avatar
    3 posts
    Member since:
    Apr 2017

    Posted 01 Nov 2019 in reply to Veselin Tsvetanov Link to this post

    Hello,

    As I understood, I can't use 2018.2.620 with Core 3, am I correct?

  6. Jerry
    Jerry avatar
    3 posts
    Member since:
    Oct 2019

    Posted 01 Nov 2019 in reply to Veselin Tsvetanov Link to this post

    Thanks Veselin, that may explain what I was seeing.

    I've gotten past the problem and I am not seeing that runtime error anymore, but I AM still seeing a thing or two that I have questions about.  I'll post separate tickets for those if I don't find the answers here in the forums.

    Thanks for your response!

    Jerry

  7. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1237 posts

    Posted 05 Nov 2019 Link to this post

    Hello all,

    Artem, that is correct. Only the latest version of the UI for ASP.NET Core suite (2019.3.1023) offers official support for .Net Core 3.0.

    Jerry, feel free to contact us if you have any further questions on the .Net Core 3.0 integration.

    Regards,
    Veselin Tsvetanov
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  8. Zoran
    Zoran avatar
    9 posts
    Member since:
    Oct 2012

    Posted 10 Aug 2020 Link to this post

    How was this resolved? I have the same error on a .net core 3.1 app
  9. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1237 posts

    Posted 13 Aug 2020 Link to this post

    Hi Zoran,

    The issue observed was due to the fact that the project was using a version of Telerik UI for ASP.NET Core which does not support .Net Core 3.0. The same issue would be present for .Net Core 3.1 too. That is why I would suggest you check the Telerik UI version used in the app. It should be R1 2020.1.114 or newer.

    Regards,
    Veselin Tsvetanov
    Progress Telerik

  10. JM
    JM avatar
    4 posts
    Member since:
    Nov 2017

    Posted 09 Feb in reply to Veselin Tsvetanov Link to this post

    Hi Veselin,

    Creating the new project in Visual Studio 2019 using Asp.net Core 3.1.....I am facing this issue Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Kendo.Mvc.Rendering.IKendoHtmlGenerator Lifetime: Transient ImplementationType: Kendo.Mvc.Rendering.KendoHtmlGenerator': Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.1.11.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.)'....

     Please help on this. Its quit urgent one.

  11. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1237 posts

    Posted 09 Feb Link to this post

    Hello,

    May I ask you to tell me which version of Telerik UI for ASP.NET Core you are creating the project with? Also, can you send me the newly created corrupt application, so I can review it locally?

    Regards,
    Veselin Tsvetanov
    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/.

  12. JM
    JM avatar
    4 posts
    Member since:
    Nov 2017

    Posted 09 Feb in reply to Veselin Tsvetanov Link to this post

    Using Kendo.for.AspNet.Core -Version 2019.1.115.Please find the attached.
  13. JM
    JM avatar
    4 posts
    Member since:
    Nov 2017

    Posted 10 Feb Link to this post

    Hi Veselin Tsvetanov, Any update on my last posts. Did you get a chance to check code. Please help on this.
  14. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1237 posts

    Posted 10 Feb Link to this post

    Hi,

    The issue observed is due to the fact that the project is using a version of a package that is not supported by Progress (note the owner):

    https://www.nuget.org/packages/Kendo.for.AspNet.Core/

    You should use the Telerik.UI.for.AspNet.Core package with version 2020.1.114 or newer. Here are some further details on how to reference packages from the Telerik private NuGet feed:

    https://docs.telerik.com/aspnet-core/installation/nuget-install

    Regards,
    Veselin Tsvetanov
    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/.

Back to Top