.NET 5.0 - Radzen Blazor

Is the Radzen team already working on something about .NET 5?

Yes, we will release .NET 5.0 support later this week or early next week.

2 Likes

I just installed the new Radzen 2.54.9, which promises to support .NET 5.0. But it's not working correctly.
I installed the new .NET 5.0 SDK (v5.0.100), changed TargetFramework to net5.0 in my .csproj file and updated all nuget packages to the latest version.
If I start the application, I can see the login screen, but after entering username and password it doesn't load anything. I also tried to debug via Visual Studio 2019 Preview, but no error message appears, even if I changed the log to trace.
I guess there's something wrong about the Microsoft.AspNetCore.Identity.EntityFrameworkCore NuGet package. If I downgrade it to version 3.1.10, everything works as expected.

Did anyone manage to get the 5.0 version of this package to work?

1 Like

No, it's not going to work like this, especially for applications with security. There are different migrations for security tables in .NET 5.0 compared to .NET Core 3.1. The only way is to create new project specifically for .NET 5.0:

Here the same problem occurred, even creating a new project in Radzen with .NET 5.0, new database ...

Check your browser console and Radzen output for errors. If you use same application name used before with different .NET version you might need to clear your browser cache.

1 Like

Hi enchev,

tried what you suggested, but had no success: after LOGIN the app doesn't show the index page.

Radzen Version 2.55.1

Please have a look, this is exactly what I've tried to reproduce the strang behaviour:

  1. Init a new .NET 5 Blazor app straight out of the box like:

  2. Add a dummy database in Local SQL Server with some sample tables:

  3. Set index page as my start-page:
    image

  4. Run the app, everything works fine so far, index page is shown:

  5. Now I add security:
    image

  6. Modify access of the index page to 'authenticated':

  7. Run the App again, I'm redirected to login page, fine. There I register a new account and check, if it is stored using SSMS: the new user exists in the database, fine

  8. Try to log in with this new account, and watch the console for errors. Before pressing LOGIN there is no error in console:

  9. After pressing LOGIN there is still no error in console, but no redirect to INDEX page, stuck in nowhere, either:

  10. This is the Radzen Output, which I cleared just before I hit LOGIN button. After pressing LOGIN Radzen reports:

    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
          Request starting HTTP/1.1 POST http://localhost:5000/account/login application/x-www-form-urlencoded 57
    
    dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
          Executing endpoint 'Test.AccountController.Login (Test)'
    
    dotnet: info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
          Route matched with {action = "Login", controller = "Account", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Login(System.String, System.String) on controller Test.AccountController (Test).
    
    dotnet: info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
          Entity Framework Core 5.0.0 initialized 'ApplicationIdentityDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None
    
    dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20101]
          Executed DbCommand (26ms) [Parameters=[@__normalizedUserName_0='?' (Size = 256)], CommandType='Text', CommandTimeout='30']
          SELECT TOP(1) [a].[Id], [a].[AccessFailedCount], [a].[ConcurrencyStamp], [a].[Email], [a].[EmailConfirmed], [a].[LockoutEnabled], [a].[LockoutEnd], [a].[NormalizedEmail], [a].[NormalizedUserName], [a].[PasswordHash], [a].[PhoneNumber], [a].[PhoneNumberConfirmed], [a].[SecurityStamp], [a].[TwoFactorEnabled], [a].[UserName]
          FROM [AspNetUsers] AS [a]
          WHERE [a].[NormalizedUserName] = @__normalizedUserName_0
    
    dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20101]
          Executed DbCommand (3ms) [Parameters=[@__user_Id_0='?' (Size = 450)], CommandType='Text', CommandTimeout='30']
          SELECT [a].[Id], [a].[ClaimType], [a].[ClaimValue], [a].[UserId]
          FROM [AspNetUserClaims] AS [a]
          WHERE [a].[UserId] = @__user_Id_0
    
    dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20101]
          Executed DbCommand (2ms) [Parameters=[@__userId_0='?' (Size = 450)], CommandType='Text', CommandTimeout='30']
          SELECT [a0].[Name]
          FROM [AspNetUserRoles] AS [a]
          INNER JOIN [AspNetRoles] AS [a0] ON [a].[RoleId] = [a0].[Id]
          WHERE [a].[UserId] = @__userId_0
    
    dotnet: info: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler[10]
          AuthenticationScheme: Identity.Application signed in.
    
    dotnet: info: Microsoft.AspNetCore.Mvc.Infrastructure.RedirectResultExecutor[1]
          Executing RedirectResult, redirecting to /.
    
    dotnet: info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]
          Executed action Test.AccountController.Login (Test) in 433.0928ms
    info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
          Executed endpoint 'Test.AccountController.Login (Test)'
    
    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
          Request finished HTTP/1.1 POST http://localhost:5000/account/login application/x-www-form-urlencoded 57 - 302 0 - 448.9076ms
    
    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
          Request starting HTTP/1.1 GET http://localhost:5000/ - -
    
    dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
          Executing endpoint '/_Host'
    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
    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 1.8737ms
    info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
          Executed endpoint '/_Host'
    info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
          Request finished HTTP/1.1 GET http://localhost:5000/ - - - 200 - text/html;+charset=utf-8 4.8410ms
    
    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
          Request starting HTTP/1.1 POST http://localhost:5000/_blazor/disconnect multipart/form-data;+boundary=----WebKitFormBoundaryAqTOiYUOQdf76vtw 359
    
    dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
          Executed endpoint '/_blazor'
    info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
          Request finished HTTP/1.1 GET http://localhost:5000/_blazor?id=eEEjWJVP4CyA8N1DEHc_3w - - - 101 - - 13083.7000ms
    info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
          Executing endpoint 'Blazor disconnect'
    
    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 /assets/css/styles.css was not modified
    info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
          Request finished HTTP/1.1 GET http://localhost:5000/assets/css/styles.css - - - 304 - text/css 0.5083ms
    
    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
          Request starting HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/Radzen.Blazor.js - -
    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 HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/Radzen.Blazor.js - - - 304 - application/javascript 0.3754ms
    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 HTTP/1.1 GET http://localhost:5000/_framework/blazor.server.js - - - 304 - application/javascript 0.1861ms
    
    dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
          Executed endpoint 'Blazor disconnect'
    info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
          Request finished HTTP/1.1 POST http://localhost:5000/_blazor/disconnect multipart/form-data;+boundary=----WebKitFormBoundaryAqTOiYUOQdf76vtw 359 - 200 0 - 17.5649ms
    
    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[6]
          The file /assets/css/styles-generated.css was not modified
    info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
          Request finished HTTP/1.1 GET http://localhost:5000/assets/css/styles-generated.css - - - 304 - text/css 0.1946ms
    
    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
          Request starting HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/css/default.css - -
    
    dotnet: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
          The file /_content/Radzen.Blazor/css/default.css was not modified
    info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
          Request finished HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/css/default.css - - - 304 - text/css 0.3281ms
    
    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
          Request starting HTTP/1.1 POST http://localhost:5000/_blazor/negotiate?negotiateVersion=1 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 HTTP/1.1 POST http://localhost:5000/_blazor/negotiate?negotiateVersion=1 text/plain;charset=UTF-8 0 - 200 316 application/json 8.4738ms
    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 HTTP/1.1 GET http://localhost:5000/_content/Radzen.Blazor/fonts/SourceSansPro-Regular.woff - - - 304 - application/font-woff 0.3783ms
    
    dotnet: info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
          Request starting HTTP/1.1 GET http://localhost:5000/_blazor?id=ly3Idlr-AltFe1UnHPBZhw - -
    
    dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
          Executing endpoint '/_blazor'
    
    dotnet: info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1]
          Authorization was successful.
    info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1]
          Authorization was successful.
    
    dotnet: info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
          Entity Framework Core 5.0.0 initialized 'ApplicationIdentityDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None
    
    dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20101]
          Executed DbCommand (2ms) [Parameters=[@__normalizedEmail_0='?' (Size = 256)], CommandType='Text', CommandTimeout='30']
          SELECT TOP(2) [a].[Id], [a].[AccessFailedCount], [a].[ConcurrencyStamp], [a].[Email], [a].[EmailConfirmed], [a].[LockoutEnabled], [a].[LockoutEnd], [a].[NormalizedEmail], [a].[NormalizedUserName], [a].[PasswordHash], [a].[PhoneNumber], [a].[PhoneNumberConfirmed], [a].[SecurityStamp], [a].[TwoFactorEnabled], [a].[UserName]
          FROM [AspNetUsers] AS [a]
          WHERE [a].[NormalizedEmail] = @__normalizedEmail_0
    
  11. Finally I have to open the project in Visual Studio and have to roll back the NuGet package Microsoft.AspNetCore.IdentityFrameworkdCore from v5.0.0 to v3.1.10 manually. All other EF Core packages are untouched and keep on running on version v5.0.0:

  12. Now I can login with my user account and get redirected to index as expected:

Any idea?

Cheers,
FM

1 Like

Try cleaning your browser state as suggested by Microsoft's official documentation. Radzen uses the built-in security implementation so nothing specific here.

Hi there,

I tried that, cause you've postet it some days ago here as your recommended solution to this problem that licitec and MrDoe reported, too.

It does not help, and from a technical point of view I cannot imagine how this might solve the problem, either. This is what I've tried:

Any other ideas?

Maybe you can provide a working test project that is constructed using Razden and .NET 5 Blazor server and security and Microsoft.AspNetCore.IdentityFrameworkdCore 5.0.0, just the index page, nothing special. That would help us to go deeper.

Could you reproduce the behavior? Do you need a short video, where I show you the steps I tried to reproduce the strange behaviour for your analyses?

btw. I hope you do not find user feedback from us free-testers about found bugs annoying, but see it as an opportunity to further improve your software step by step based on bug reports. In a sense, this is our contribution to your product, making it even better.

Cheers,
FM

1 Like

We also tried to use the solution proposed by korchev, but we were unsuccessful.

1 Like

We were able finally to reproduce and fix the problem and we will publish update tomorrow!

2 Likes