-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Making a new Blazor WebApp in RC2, if you select individual accounts and Global Interactive server mode:
-
The template does not automatically add
@rendermode="RenderMode.InteractiveServer"to the App.razor Routes and Head Outlet components. This only occurs when using the new identity pages, when they are excluded, the rendermode is automatically added. -
When you manually add the global rendermode in, the identity pages begin giving Null Reference Exceptions in several locations. For example: visiting the Register Page throws a null reference exception in StatusMessage.razor @ line 28:
private string? MessageFromCookie => HttpContext.Request.Cookies[IdentityRedirectManager.StatusCookieName];
Removing the global rendermode from the Routes component stops the exceptions, but then eliminates the needed functionality.
Expected Behavior
The expected behavior was to be able to use the Interactive Server Render Mode globally with the new razor identity pages.
Steps To Reproduce
- Create a new blazor web app in RC2.
- Select 'Individual Accounts' for Authentication Type.
- Select 'Server' for Interactivity Type.
- Select 'Global' for Interactivity Location.
- Add
@rendermode="RenderMode.InteractiveServer"to the HeadOutlet and Routes components in /Components/App.razor. - Run the application.
- Navigate to Register or Login pages.
Exceptions (if any)
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=BlazorApp1
StackTrace:
at BlazorApp1.Components.Identity.StatusMessage.get_MessageFromCookie() in F:\BlazorApp1\BlazorApp1\Components\Identity\StatusMessage.razor:line 28
.NET Version
.NET8 RC2
Anything else?
No response