Grid taghelper causes NullReferenceException in Microsoft.AspNetCore.Razor.Language when using AddRazorRuntimeCompilation with 2024.1.130 and ASP.NET Core MVC 8.0

1 Answer 103 Views
Grid
Bill
Top achievements
Rank 1
Bill asked on 19 Feb 2024, 11:31 PM

In ASP.NET Core MVC 8.0 with KendoUI 2024.1.130, when rendering a page which contains a grid via the taghelper, if the application has enabled Razor runtime compilation, an exception will be thrown within Microsoft.AspNetCore.Razor.Language in Microsoft.AspNetCore.Razor.StringSegment.Equals.  Full stack trace attached.  This did not occur with ASP.NET Core MVC 6 and KendoUI 2022.3.  Attached is a small sample app demonstrating the problem; navigating to the grid page will fail with an exception unless AddRazorRuntimeCompilation is commented out.

A couple levels up the call stack from where the exception occurs, Razor is iterating over descriptor.BoundAttributes; one of these whose DisplayName is "System.Collections.Generic.IDictionary<System.String, System.String> Kendo.Mvc.TagHelpers.GridTagHelper.Templates" has a Name property of null which is what results in the exception.

Stoyan
Telerik team
commented on 22 Feb 2024, 11:19 AM

Hello Bill,

Thank you for your report.

We are aware of the issue and an investigation on the matter is ongoing.

In that context your debugging insights are much appreciated.

I will let you know, when more information is available.

Bill
Top achievements
Rank 1
commented on 22 Feb 2024, 03:48 PM

Note that Razor runtime compilation can also be triggered by having Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation listed in the ASPNETCORE_HOSTINGSTARTUPASSEMBLIES environment variable.  That was causing the exception to continue happening in my app even after commenting out the call to AddRazorRuntimeCompilation.
Robert
Top achievements
Rank 1
commented on 25 Mar 2024, 11:07 PM | edited

This actually started happening with version 2023.2.606, I kept rolling back versions until I found one that didn't throw the exception.  Other controls we use seem unaffected; we are just having an issue with the Grid control.

It took me a few hours today to track this down.  I wish I would've seen this post sooner.

Alexander
Telerik team
commented on 28 Mar 2024, 09:39 AM

Hi,

I'm happy to let you know that a fellow developer subject matter expert has proceeded with the initiative of rectifying the reported behavior by providing a fix candidate. It is currently pending review by our Quality Assurance Engineers.

Mike
Top achievements
Rank 1
Iron
commented on 16 Apr 2024, 06:50 PM

Is there an ETA on the release of this bug fix?
Alexander
Telerik team
commented on 17 Apr 2024, 02:35 PM

Hi Mike,

Currently, we do not have an estimate on whether the fix will be released. However, what I can personally do is raise the awareness of this item in order to triage the item for testing.

Bill
Top achievements
Rank 1
commented on 17 Apr 2024, 02:47 PM

This problem wastes a lot of developer time.  Disabling runtime compilation means that the app has to be restarted to pick up any changes in cshtml files instead of just refreshing the page in the browser.  (Edit & Continue or Hot Reload might resolve that issue, but I've never gotten those to work.)  The apps I work on use grids on 80+% of the pages, so I have to keep runtime compilation off, so changing the edit-refresh cycle to edit-restart-refresh adds a lot of time.
Alexander
Telerik team
commented on 19 Apr 2024, 06:40 PM

Hi Bill,

I understand your cause of frustration on this one. I will forward this feedback to my manager, in order to see whether we can speed up and prioritize testing and release for the fix candidate. Since this seems to be a blocker for other customers as well.

1 Answer, 1 is accepted

Sort by
0
Accepted
Stoyan
Telerik team
answered on 27 Feb 2024, 03:43 PM | edited on 27 Feb 2024, 03:53 PM

Hi Bill,

Thank you for the thorough information you have shared.

I am sure your input will be very helpful to community members who face the same issue.

With that being said, after some research I was able to conclude that the reported behavior is indeed a bug. Consequently, I've logged a Bug Report in our public Feedback Portal. You can follow the Bug Report here.

Finally, as a token of gratitude for your help to identify the discussed faulty behavior I have updated your Telerik points.

Regards,
Stoyan
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Mike
Top achievements
Rank 1
Iron
commented on 27 Mar 2024, 09:16 PM

Has there been any progress on this bug as I too am experiencing it with version 2024.1.319 but, oddly, only in local debug.

As an additional note, it appears the header alignment logic is also not working when we do something like this:

header-html-attributes='new Dictionary<string,object> { ["class"]="text-end" }'

Tags
Grid
Asked by
Bill
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or