-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsarea-identityIncludes: Identity and providersIncludes: Identity and providersinvestigate
Milestone
Description
REGRESSION INFO: Not repro on VS 17.14.21
INSTALL STEP
- Clean machine: Win11 x64 23H2 ENU
- Install VS 18.3 Insiders 1.2 from https://aka.ms/vs/18/insiders/vs_Enterprise.exe
- Web workload
- Check 8.0/9.0 runtime
- Includes SDK 10.0.100
REPRO STEPS
-
File > New > Project > Blazor Web App > .NET 10.0 > Server ~ Per page/component > create.
-
Right click the project > Add > New Scaffolded Item > Identity > Blazor Identity
- DbContext class: Click + for Data context class and keep the context name by default
- Database provider: Select "SQL Server/SQLite"
- Click Add
-
After scaffolding completed
- You may encounter BUG 2611149, which requires updating the Microsoft.Build.* package version.
- Update "BlazorApp1ContextConnection" to "BlazorApp1Context"
-
Open Tools > NuGet Package Manager > Package Manager Console and run the following code.
Add-Migration CreateIdentitySchema -context <Contextname>
Update-Database -context <Contextname>
- Run the project and register a new user
NOTE:
- There have been similar bugs before: #3609 and #3657
- This issue does not reproduce in 9.0/8.0 project
ACTUAL:
The user register failed with an exception


fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: IdentityRedirectManager can only be used during static rendering.
at BlazorApp8.Components.Account.IdentityRedirectManager.RedirectTo(String uri) in C:\Users\v-reinawang\source\repos\BlazorApp8\BlazorApp8\Components\Account\IdentityRedirectManager.cs:line 32
at BlazorApp8.Components.Account.IdentityRedirectManager.RedirectTo(String uri, Dictionary`2 queryParameters) in C:\Users\v-reinawang\source\repos\BlazorApp8\BlazorApp8\Components\Account\IdentityRedirectManager.cs:line 40
at BlazorApp8.Components.Account.Pages.Register.RegisterUser(EditContext editContext) in C:\Users\v-reinawang\source\repos\BlazorApp8\BlazorApp8\Components\Account\Pages\Register.razor:line 96
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.Forms.EditForm.HandleSubmitAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.<WaitForNonStreamingPendingTasks>g__Execute|58_0()
at Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
at Microsoft.AspNetCore.Components.Endpoints.RazorComponentEndpointInvoker.RenderComponentCore(HttpContext context)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<<InvokeAsync>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Builder.ServerRazorComponentsEndpointConventionBuilderExtensions.<>c__DisplayClass1_1.<<AddInteractiveServerRenderMode>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Antiforgery.Internal.AntiforgeryMiddleware.InvokeAwaited(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
EXPECTED
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsarea-identityIncludes: Identity and providersIncludes: Identity and providersinvestigate