telerik/kendo-ui-core

DataSourceRequest Error is thrown in Kendo.MVC for asp.net Core 2.0 web application targeting .NET Framework 4.6.1

mparvanov opened this issue · 13 comments

Bug report

The problematic scenario happens in case the TargetFramework for the Core 2.0 web application is .NET Framework 4.6.1.

Reproduction of the problem

  1. Create a new ASP.NET Core 2.0 Web Application targeting .NET Framework (Select .NET Framework from the New ASP.NET Core Application window)
  2. Follow the getting started article to configure the ASP.NET Core project
  3. Add a Grid component to the application with sorting and filtering enabled
  4. Run the application

Current behavior

The following internal server error is thrown in Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModelAsync(ModelBindingContext bindingContext)
:

_An unhandled exception occurred while processing the request.

TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.TaskCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.0.0.0, Culture=neutral,_

Expected/desired behavior

No errors occur. Sorting and Filtering are working properly

Environment

  • Kendo UI version: 2017.2.823

Hello, when do you plan to release the fix? thank you

I just installed the latest 2017.2.901 internal build and this was not fixed in that build. Is there a new internal release going out today?

The fix is included in the internal release version 2017.2.901.

I Installed it Friday with no luck and cleaned up all the references. It was still giving me the same error on a 461 project. Not sure what else to try but I will install it again and report back.

Thanks for the input. We are looking forward to receiving your feedback.

I grabbed 2017.2.901 over the weekend, and can confirm that I am also still encountering the same issue while targeting 4.6.1.

System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.TaskCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
at Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModelAsync(ModelBindingContext bindingContext)
at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder.d__2.MoveNext()

The error is definitely present in 2017.2.901, and resides within DataSourceRequestModelBinder. I can swap it out for a custom modelbinder class I've used in the past (which was separately updated to support Core 2.0), and avoid the error as test case. For obvious reasons though, I'd prefer to be using the version built into the Kendo MVC wrappers.

I'm happy to provide stack info, or anything else needed, in order to help resolve; just let me know what you need.

Same problem with me (tested on 2017.2.901):
System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal .TaskCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.0.0.0, Cultu re=neutral, PublicKeyToken=adb9793829ddae60'. at Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModelAsync(ModelBindingConte xt bindingContext) at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder.<BindM odelAsync>d__2.MoveNext()

@CallMeOzz I am sorry Ozz but can you provide your ModelBinder? a workaround would help me a lot

I tested the sample project that your support team provided me and it is not fixed.
Change the grid to server operation and it will break with the exact same error. Please fix this today, we can't afford to have this go another day.

Thank you for your comments. The problem was additionally researched and it turned out that the fix was not included in the 2017.2.901 internal release by a mistake. We have already started the procedure for publishing a new internal release which is supposed to be available in the accounts by the end of the day. Please accept our apologies for the inconvenience caused and thank you for your understanding.
We are looking forward to receiving your feedback about the upcoming internal build.

Thank you this is great news! I look forward to testing it once it is released.

@petrce, terribly sorry I didn't see your request earlier. Sounds like the new build is coming shortly, and the issue should hopefully be resolved by this evening.

If troubles persist for any reason, I can walk you through how to make the necessary changes. I'd rather not post or send source code for a closed-source product and risk violating anyone's licensing terms, but the changes are easy to make if you have access to the source code for the current release/production build. In essence, it is just a matter of replacing two different sections of code, since they rely on (1) a namespace and (2) an extension method that were marked obsolete and removed from Core 2.0.

As I mentioned above, its always better to get the official build from Telerik, but I should be able to help you get up and running temporarily, if the build gets delayed for any reason, or if problems persist. You just need to make sure that you have downloaded the source for the release build of the wrappers as a starting point.

Regards,
Ozz

We are experiencing difficulties in releasing the internal build due to technical issues in the build environment.
You could find the fix in the nuget attached to this post for the time being.