Error when starting new application

Hello Radzen Team,
after creating a new Blazor App with Security. After creating crud pages für one Table and starting the app (nothing more) the following error occurs:

What went wrong? What can i do?

Regards
Thomas

I tested around a bit and after disabling security the app starts. Must have something to do with it...

I'm unable to reproduce such problem. Please verify if you are using latest Radzen (2.30.2).

Hi enchev,
there are several errors. i have made a video:

and the content of the output window:
radzen: Generating code ...
radzen: Code generation done in 391ms.
dotnet: watch : Started

dotnet: info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\brigh\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.

dotnet: info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 3.0.0 initialized 'ApplicationIdentityDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None

dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20100]
Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT OBJECT_ID(N'[__EFMigrationsHistory]');

dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20100]
Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT OBJECT_ID(N'[__EFMigrationsHistory]');

dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20100]
Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [MigrationId], [ProductVersion]
FROM [__EFMigrationsHistory]
ORDER BY [MigrationId];

dotnet: info: Microsoft.EntityFrameworkCore.Migrations[20405]
No migrations were applied. The database is already up to date.

dotnet: info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000

dotnet: info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Entwicklung\test\server

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/

dotnet: warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the https port for redirect.

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/_Host'

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
Route matched with {page = "/_Host", action = "", controller = ""}. Executing page /_Host

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[103]
Executing an implicit handler method - ModelState is Valid

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[104]
Executed an implicit handler method, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.

dotnet: info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[4]
Executed page /_Host in 95.70700000000001ms

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/_Host'

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 244.39630000000002ms 200 text/html; charset=utf-8

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/Radzen.Blazor.js

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/assets/css/styles.css

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
The file /_content/Radzen.Blazor/Radzen.Blazor.js was not modified

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 10.5827ms 304 application/javascript

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
Sending file. Request path: '/assets/css/styles.css'. Physical path: 'C:\Entwicklung\test\server\wwwroot\assets\css\styles.css'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 5.9316ms 200 text/css

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/_framework/blazor.server.js
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
The file /_framework/blazor.server.js was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 1.1471ms 304 application/javascript

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/assets/css/styles-generated.css

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
Sending file. Request path: '/assets/css/styles-generated.css'. Physical path: 'C:\Entwicklung\test\server\wwwroot\assets\css\styles-generated.css'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 0.7044ms 200 text/css

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/css/humanistic.css

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
The file /_content/Radzen.Blazor/css/humanistic.css was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 0.4208ms 304 text/css

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://localhost:5000/_blazor/negotiate text/plain;charset=UTF-8 0

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/_blazor/negotiate'

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/_blazor/negotiate'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 12.7645ms 200 application/json

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/fonts/SourceSansPro-Regular.woff

dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
The file /_content/Radzen.Blazor/fonts/SourceSansPro-Regular.woff was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 0.5653ms 304 application/font-woff

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://localhost:5000/_blazor?id=l9Tg6KcnPypkPwAeGSx98Q

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/_blazor'

dotnet: warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Failed to compare two elements in the array.
System.InvalidOperationException: Failed to compare two elements in the array.
---> System.InvalidOperationException: The following routes are ambiguous:
'/' in 'Test.Pages.AvvSchluessels'
'/' in 'Test.Pages.ApplicationUsers'

at Microsoft.AspNetCore.Components.RouteTableFactory.RouteComparison(RouteEntry x, RouteEntry y)
at System.Collections.Generic.ComparisonComparer1.Compare(T x, T y) at System.Linq.EnumerableSorter2.CompareAnyKeys(Int32 index1, Int32 index2)
at System.Collections.Generic.ComparisonComparer1.Compare(T x, T y) at System.Collections.Generic.ArraySortHelper1.InsertionSort(T[] keys, Int32 lo, Int32 hi, Comparison1 comparer) at System.Collections.Generic.ArraySortHelper1.IntroSort(T[] keys, Int32 lo, Int32 hi, Int32 depthLimit, Comparison1 comparer) at System.Collections.Generic.GenericArraySortHelper1.Sort(T[] keys, Int32 index, Int32 length, IComparer1 comparer) --- End of inner exception stack trace --- at System.Collections.Generic.GenericArraySortHelper1.Sort(T[] keys, Int32 index, Int32 length, IComparer1 comparer) at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer1 comparer)
at System.Linq.EnumerableSorter2.QuickSort(Int32[] keys, Int32 lo, Int32 hi) at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count)
at System.Linq.OrderedEnumerable1.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Microsoft.AspNetCore.Components.RouteTableFactory.Create(Dictionary2 templatesByHandler) at Microsoft.AspNetCore.Components.RouteTableFactory.Create(IEnumerable1 componentTypes)
at Microsoft.AspNetCore.Components.RouteTableFactory.Create(IEnumerable1 assemblies) at Microsoft.AspNetCore.Components.Routing.Router.SetParametersAsync(ParameterView parameters) at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

dotnet: fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'XomQvZb8U8CqtgOeMhlfQTooI7mwwYZoINvjmfIrjwQ'.
System.InvalidOperationException: Failed to compare two elements in the array.
---> System.InvalidOperationException: The following routes are ambiguous:
'/' in 'Test.Pages.AvvSchluessels'
'/' in 'Test.Pages.ApplicationUsers'

at Microsoft.AspNetCore.Components.RouteTableFactory.RouteComparison(RouteEntry x, RouteEntry y)
at System.Collections.Generic.ComparisonComparer1.Compare(T x, T y) at System.Linq.EnumerableSorter2.CompareAnyKeys(Int32 index1, Int32 index2)
at System.Collections.Generic.ComparisonComparer1.Compare(T x, T y) at System.Collections.Generic.ArraySortHelper1.InsertionSort(T[] keys, Int32 lo, Int32 hi, Comparison1 comparer) at System.Collections.Generic.ArraySortHelper1.IntroSort(T[] keys, Int32 lo, Int32 hi, Int32 depthLimit, Comparison1 comparer) at System.Collections.Generic.GenericArraySortHelper1.Sort(T[] keys, Int32 index, Int32 length, IComparer1 comparer) --- End of inner exception stack trace --- at System.Collections.Generic.GenericArraySortHelper1.Sort(T[] keys, Int32 index, Int32 length, IComparer1 comparer) at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer1 comparer)
at System.Linq.EnumerableSorter2.QuickSort(Int32[] keys, Int32 lo, Int32 hi) at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count)
at System.Linq.OrderedEnumerable1.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at Microsoft.AspNetCore.Components.RouteTableFactory.Create(Dictionary2 templatesByHandler) at Microsoft.AspNetCore.Components.RouteTableFactory.Create(IEnumerable1 componentTypes)
at Microsoft.AspNetCore.Components.RouteTableFactory.Create(IEnumerable1 assemblies) at Microsoft.AspNetCore.Components.Routing.Router.SetParametersAsync(ParameterView parameters) at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/_blazor'

dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 199.0078ms 101

radzen: Stopped server.

I too have had this error. All I did was create a new app. Add the DB and auto generate CRUD pages. Add security.Then I tried to manually add a CRUD page and I got the same error.

HTH.

Paul.

We are still unable to reproduce this issue. We are probably missing a step or it is somehow related to the database. Having your app to troubleshoot locally would definitely help.

i have packed the project. How can i sent it to you? can not post it here because of sensible data within the project (connectionstring :-))

Thomas

after closing radzen and start again the error is gone:

definetly it has something to do with cultures and/or authentication

Thomas

Thanks for the detailed explanation. We managed to reproduce the problem. A fix will be included in the next Radzen release.

The project I've been working on has randomly started doing this again:

dotnet: warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: Failed to compare two elements in the array.
System.InvalidOperationException: Failed to compare two elements in the array.
 ---> System.InvalidOperationException: The following routes are ambiguous:
'/' in 'SuttonPokerResults.Pages.PokerGalleries'
'/' in 'SuttonPokerResults.Pages.PokerSeason'

I was working on it fine one day and today I started getting this out of the blue.

Any advice as to where to start looking at the issue?

Thanks.

Two pages seem to have the same route "/". Did you put some of those in the code generation ignore list?

I wouldn't have thought so as I don't actually know what you mean. :neutral_face:

Ah, I see what you mean...

@page "/"
@page "/poker-season"

@page "/"
@page "/poker-galleries"

I didn't do that, no. Strange

Took away the "/" route on each page and it works fine now. Still wondering how that got there though.