Aggregate problem in 2023.1.425

1 Answer 304 Views
Grid
Dave
Top achievements
Rank 2
Iron
Iron
Dave asked on 01 May 2023, 10:12 PM

This is how my grid is defined - and was working before upgrading to 2023.1.425 (this is a Razor page):

@(Html.Kendo().Grid(Model.InvoiceList)
	.Name("ResultGrid")
	.Groupable(ga => ga.ShowFooter(false))
	.DataSource(ds => ds
		.Ajax()
		.ServerOperation(false)
		.Group(gr => gr.Add(gp => gp.CompanyName))
		.Aggregates(aggregates =>
		{
			aggregates.Add(field => field.CheckTotal).Sum();
			aggregates.Add(field => field.CheckTotal).Count();
		})
	)
	.Mobile(MobileMode.Phone)
	.Sortable(s => s
		.AllowUnsort(true)
		.SortMode(GridSortMode.Mixed)
		.ShowIndexes(true)
	)
	.Scrollable(s => s.Enabled(true).Height("auto"))
	.Columns(c =>
	{
		c.Bound(res => res.InvoiceID).Title("ID").ClientTemplate("<a href='/invoicesummary/#= InvoiceID #' target='_blank'>#= InvoiceID #</a>");
		c.Bound(res => res.CheckDate).Title("Check Date").Format("{0:MM/dd/yyyy}");
		c.Bound(res => res.CheckNo).Title("Check No");
		c.Bound(res => res.CheckTotal).Title("Check Amount").Format("{0:C2}");
		c.Bound(res => res.PayTo).Title("Payee");
		c.Bound(res => res.CompanyName).Title("Company Name")
			.ClientGroupHeaderTemplate("#= data.value # - Total: #= kendo.format('{0:C2}', data.aggregates.CheckTotal.sum) # in #= data.aggregates,CheckTotal.count # invoice(s)").Hidden(true);
	})
	.ColumnMenu(m => m
		.ComponentType("modern")
	)
	.Reorderable(r => r.Columns(true))
	.Resizable(rs => rs.Columns(true))
)

Here is the error I am getting:

An unhandled exception occurred while processing the request.
MissingMethodException: Method not found: 'System.Exception Roslyn.Utilities.ExceptionUtilities.get_Unreachable()'.
Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseQualifiedNameRight(NameOptions options, NameSyntax left, SyntaxToken separator)

Stack Query Cookies Headers Routing
MissingMethodException: Method not found: 'System.Exception Roslyn.Utilities.ExceptionUtilities.get_Unreachable()'.
Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseQualifiedNameRight(NameOptions options, NameSyntax left, SyntaxToken separator)
Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseQualifiedName(NameOptions options)
Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseUnderlyingType(ParseTypeMode mode, NameOptions options)
Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseTypeCore(ParseTypeMode mode)
Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseType(ParseTypeMode mode)
Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseTypeName()
Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseTypeName(string text, int offset, ParseOptions options, bool consumeFullText)
Kendo.Mvc.Infrastructure.Implementation.ClassFactory.DeclareDynamicProperty(DynamicProperty property)
System.Linq.Enumerable+SelectEnumerableIterator<TSource, TResult>.ToArray()
Kendo.Mvc.Infrastructure.Implementation.ClassFactory.GetDynamicClass(IEnumerable<DynamicProperty> properties)
Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionNewExpression(IEnumerable<Expression> propertyValuesExpressions)
Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression()
Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding()
Kendo.Mvc.Infrastructure.Implementation.Expressions.QueryableAggregatesExpressionBuilder.CreateMemberBindings()+MoveNext()
System.Collections.Generic.LargeArrayBuilder<T>.AddRange(IEnumerable<T> items)
System.Collections.Generic.EnumerableHelpers.ToArray<T>(IEnumerable<T> source)
System.Dynamic.Utils.CollectionExtensions.ToReadOnly<T>(IEnumerable<T> enumerable)
System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable<MemberBinding> bindings)
Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression()
Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateSelectExpression()
Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery()
Kendo.Mvc.Extensions.QueryableExtensions.Aggregate(IQueryable source, IEnumerable<AggregateFunction> aggregateFunctions)
Kendo.Mvc.Extensions.QueryableExtensions.CreateDataSourceResult<TModel, TResult>(IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState, Func<TModel, TResult> selector)
Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState)
Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request)
Kendo.Mvc.UI.DataSource.Process(DataSourceRequest request, bool processData)
Kendo.Mvc.UI.Grid<T>.ProcessDataSource()
Kendo.Mvc.UI.Grid<T>.ProcessSettings()
Kendo.Mvc.UI.WidgetBase.RenderHtml(TextWriter writer)
Kendo.Mvc.UI.WidgetBase.ToHtmlString()
Kendo.Mvc.UI.Fluent.WidgetBuilderBase<TViewComponent, TBuilder>.ToHtmlString()
Kendo.Mvc.UI.Fluent.WidgetBuilderBase<TViewComponent, TBuilder>.WriteTo(TextWriter writer, HtmlEncoder encoder)
Microsoft.AspNetCore.Mvc.ViewFeatures.Buffers.ViewBuffer.WriteToAsync(TextWriter writer, HtmlEncoder encoder)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
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.Infrastructure.ResourceInvoker.<InvokeResultAsync>g__Logged|22_0(ResourceInvoker invoker, IActionResult result)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_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>g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_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>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Show raw exception details
System.MissingMethodException: Method not found: 'System.Exception Roslyn.Utilities.ExceptionUtilities.get_Unreachable()'.
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseQualifiedNameRight(NameOptions options, NameSyntax left, SyntaxToken separator)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseQualifiedName(NameOptions options)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseUnderlyingType(ParseTypeMode mode, NameOptions options)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseTypeCore(ParseTypeMode mode)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseType(ParseTypeMode mode)
   at Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.LanguageParser.ParseTypeName()
   at Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ParseTypeName(String text, Int32 offset, ParseOptions options, Boolean consumeFullText)
   at Kendo.Mvc.Infrastructure.Implementation.ClassFactory.DeclareDynamicProperty(DynamicProperty property)
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
   at Kendo.Mvc.Infrastructure.Implementation.ClassFactory.GetDynamicClass(IEnumerable`1 properties)
   at Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionNewExpression(IEnumerable`1 propertyValuesExpressions)
   at Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression()
   at Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding()
   at Kendo.Mvc.Infrastructure.Implementation.Expressions.QueryableAggregatesExpressionBuilder.CreateMemberBindings()+MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Dynamic.Utils.CollectionExtensions.ToReadOnly[T](IEnumerable`1 enumerable)
   at System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
   at Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression()
   at Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilder.CreateSelectExpression()
   at Kendo.Mvc.Infrastructure.Implementation.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery()
   at Kendo.Mvc.Extensions.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions)
   at Kendo.Mvc.Extensions.QueryableExtensions.CreateDataSourceResult[TModel,TResult](IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState, Func`2 selector)
   at Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState)
   at Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request)
   at Kendo.Mvc.UI.DataSource.Process(DataSourceRequest request, Boolean processData)
   at Kendo.Mvc.UI.Grid`1.ProcessDataSource()
   at Kendo.Mvc.UI.Grid`1.ProcessSettings()
   at Kendo.Mvc.UI.WidgetBase.RenderHtml(TextWriter writer)
   at Kendo.Mvc.UI.WidgetBase.ToHtmlString()
   at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()
   at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.WriteTo(TextWriter writer, HtmlEncoder encoder)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.Buffers.ViewBuffer.WriteToAsync(TextWriter writer, HtmlEncoder encoder)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultAsync>g__Logged|22_0(ResourceInvoker invoker, IActionResult result)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

If I comment out the Aggregates key, everything works fine except I don't have my summarization I need to display.  Like I said, this worked right up until I upgraded the library to the new version.  I also made sure that all of the scripts and CSS are compatible versions.  I have no idea what this message is telling me.  I read something on StackOverflow that suggested adding a parameter-less constructor to the model, but that did not work.

Anything anyone can point would be much appreciated.

1 Answer, 1 is accepted

Sort by
0
Dave
Top achievements
Rank 2
Iron
Iron
answered on 02 May 2023, 03:23 PM

Well, I solved my own problem - but, to be fair to me, one Telerik helped to create.

If you look at the NuGet dependencies for UI for ASP.NET Core, it shows the Microsoft.CodeAnalysis version should be >= 4.4.0.  I had v4.5.0 installed, and apparently this broke the grid (and probably other Telerik components as well).  Once I uninstalled v 4.5.0 and then installed v4.4.0, everything magically started to work.

So problem solved for the moment.

Alexander
Telerik team
commented on 04 May 2023, 02:33 PM

Hi David,

Thank you for taking the time to share such comprehensive details in regard to the produced behavior. And possible workaround at the moment.

To be frank, our Microsoft.CodeAnalysis indeed seem to prior to our latest release serve the 4.0.0 version. Thus, we had an internal effort to bump this dependency to 4.4.0.

Your feedback is much appreciated. We will continue to monitor such reports and based on them, asses whether another initiative in bumping the versions should be undertaken.

Tags
Grid
Asked by
Dave
Top achievements
Rank 2
Iron
Iron
Answers by
Dave
Top achievements
Rank 2
Iron
Iron
Share this question
or