Sorry, but your code doesn't work. Today I downloaded it and compiled it successfully, but the Visual Studio 2022 (17.9.0) gives the following error when executing it:
System.TypeLoadException: 'Could not load type 'Microsoft.AspNetCore.Components.Web.RenderModeInteractiveAutoAttribute' from assembly 'Microsoft.AspNetCore.Components.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.'
Also see attached screenshot

Sorry, but your code doesn't work. Today I downloaded it and compiled it successfully, but the Visual Studio 2022 (17.9.0) gives the following error when executing it:
System.TypeLoadException: 'Could not load type 'Microsoft.AspNetCore.Components.Web.RenderModeInteractiveAutoAttribute' from assembly 'Microsoft.AspNetCore.Components.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.'
Also see attached screenshot
