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

12 Answers 5709 Views
General Discussions
Jerry
Top achievements
Rank 1
Jerry asked on 24 Oct 2019, 01:32 PM

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


Veselin Tsvetanov
Telerik team
commented on 29 Oct 2019, 07:40 AM

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.
Jerry
Top achievements
Rank 1
commented on 29 Oct 2019, 04:23 PM

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

12 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 31 Oct 2019, 01:36 PM

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.
Artem
Top achievements
Rank 1
commented on 01 Nov 2019, 09:04 AM

Hello,

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

Jerry
Top achievements
Rank 1
commented on 01 Nov 2019, 03:42 PM

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

Veselin Tsvetanov
Telerik team
commented on 05 Nov 2019, 12:31 PM

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.
Zoran
Top achievements
Rank 1
Veteran
commented on 10 Aug 2020, 02:28 PM

How was this resolved? I have the same error on a .net core 3.1 app
Veselin Tsvetanov
Telerik team
commented on 13 Aug 2020, 06:29 AM

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

JM
Top achievements
Rank 1
commented on 09 Feb 2021, 09:21 AM

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.

Veselin Tsvetanov
Telerik team
commented on 09 Feb 2021, 01:03 PM

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/.

JM
Top achievements
Rank 1
commented on 09 Feb 2021, 02:43 PM

Using Kendo.for.AspNet.Core -Version 2019.1.115.Please find the attached.
JM
Top achievements
Rank 1
commented on 10 Feb 2021, 01:09 PM

Hi Veselin Tsvetanov, Any update on my last posts. Did you get a chance to check code. Please help on this.
0
Veselin Tsvetanov
Telerik team
answered on 10 Feb 2021, 02:59 PM

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/.

0
JM
Top achievements
Rank 1
answered on 16 Mar 2021, 12:41 PM
Hi Veselin , Not able to find the mentioned version 2020.1.114 in Nuget Package. Please review the screenshots.
0
JM
Top achievements
Rank 1
answered on 18 Mar 2021, 04:49 AM
Hi Veselin Tsvetanov, Please help on the above issue.
0
Nencho
Telerik team
answered on 19 Mar 2021, 12:13 PM

Hello, Jerry,

As I can see from the provided screenshot the Telerik Nuget feed is not selected as a Package Source. Please refer to the following documentation article demonstrating how to set up the Telerik Nuget feed, in order to be able to use the needed packages:

https://docs.telerik.com/aspnet-core/installation/nuget-install#setup-the-telerik-nuget-feed 

Hope this would help.

Regards,
Nencho
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
JM
Top achievements
Rank 1
answered on 24 Mar 2021, 01:00 PM
Hi Nencho / Veselin, Not able to find the mentioned version 2020.1.114 in Nuget Package. Please review the attached file for your reference.
0
JM
Top achievements
Rank 1
answered on 25 Mar 2021, 02:11 PM
Hi Nencho, Any update on this. It's quite urgent.
0
Nencho
Telerik team
answered on 29 Mar 2021, 09:30 AM

Hello,

As my colleague Vesselin mentioned - You should use the Telerik.UI.for.AspNet.Core package. As I can see, you are attempting to search for Kendo UIForASP.NET Core. while the package name is Telerik UI for ASP.NET Core.

Could you please try again and let me know if the package is still not visible?

Regards,
Nencho
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
JM
Top achievements
Rank 1
answered on 29 Mar 2021, 09:54 AM
Hi Nencho, Still i am not find the Telerik.UI.for.AspNet.Core in nuget.org while searching from my solution. Please review the attached copy.
0
JM
Top achievements
Rank 1
answered on 29 Mar 2021, 09:59 AM
Hi Nencho / Veslin , Due to this issue struggling a lot in our important deliverables... If possible can we setup the meeting on this.
0
Nencho
Telerik team
answered on 29 Mar 2021, 01:31 PM

Hello,

We've double-checked the license that you have associated with the email that you are submitting this thread (jeyarani.rajadurai@nttdata.com) and you do have an active license associated with it. Hence, if you went through the steps from the article below, the packages should be listed:
https://docs.telerik.com/aspnet-core/installation/nuget-install#setup-the-telerik-nuget-feed 

First, I would suggest you double-check in YourAccount if you are able to see the needed Telerik UI for ASP.NET Core versions, available for manual download: https://www.telerik.com/account/product-download?product=UIASPCORE 

If you are able to see them, that would confirm that there's no actual issue with the available versions for our account. That would suggest that there's an issue with the NugetSource setup. If that's the case, I would suggest you to remove the source that you've set up and add it again, following the article step by step:

https://docs.telerik.com/aspnet-core/installation/nuget-install#setup-the-telerik-nuget-feed 

Please give it a try and let us know the results.

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

0
Russell
Top achievements
Rank 1
Iron
Iron
answered on 22 Jul 2021, 11:33 PM

I am running into this error:

- Visual Studio 2019 with DotNet 5

- Created ASPNet Core MVC webapp

- Downloaded Kendo UI for aspnet Core installer, ran it.

- Added Telerik references to _ViewImports.cshtml and _Layout.cshtml, no love.

- In nuget,  added telerik repository

- Typed Telerik.UI  into nuget search and installed Kendo.for.AspNet.Core. That is the only component available to me?

- Project builds. When I run it I get the following:

Building...
Unhandled exception. System.AggregateException: 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=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.)
 ---> System.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=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
 ---> System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimeConstructorInfo.get_Signature()
   at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy()
   at System.Reflection.RuntimeConstructorInfo.GetParameters()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, IServiceProviderEngine engine, ServiceProviderOptions options)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, IServiceProviderEngine engine, 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()

 

 

Thoughts? I told my PM that Kendo would improve my productivity and I can't even get the trial license to work...

Russell
Top achievements
Rank 1
Iron
Iron
commented on 22 Jul 2021, 11:42 PM

Ah, found the problem. The little drop down box at the top right of the Nuget Package manager screen needs to be adjust to point to the telerik repository. Then the correct Telerik.UI.for.AspNet.Core.Trial comes up.
Tags
General Discussions
Asked by
Jerry
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
JM
Top achievements
Rank 1
Nencho
Telerik team
Russell
Top achievements
Rank 1
Iron
Iron
Share this question
or