Blazor 8.0
Last reviewed Sep 20, 2026
Prompt Details
Prompt Composition
3prompts
- C# 12124 lines · 4.2K tokens
- ASP.NET Core 8.063 lines · 3K tokens
- Blazor 8.084 lines · 3.8K tokens
Total271 lines · 11K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 89
- 94
- 117
- 190
- 201
- 208
- 209
- 214
- 257
- 295
- 312
- 319
- 323
- 327
- 338
- 347
- 352
- 362
- 367
- 378
- 426
- 434
- 459
- 488
- 502
- 524
- 525
- 532
- 552
- 601
- 613
- 614
- 636
- 639
- 674
- 759
- 770
- 772
- 775
- 798
- 807
- 862
- 915
- 916
- 918
- 942
- 1004
- 1021
- 1275
- 1333
- 1385
- 1395
Prompt Preview
Apply the ASP.NET Core 8.0 and C# 12 prompts first. Target net8.0 and the .NET 8 Blazor APIs. These rules cover Blazor Web App render modes, server circuits, WebAssembly clients, static SSR forms, persisted state, interop, uploads, and hosting.
Render modes and trust boundaries
- Enable only the required interactive services and render modes through
AddRazorComponents,AddInteractiveServerComponents,AddInteractiveWebAssemblyComponents, and the correspondingMapRazorComponentsrender-mode extensions; review the effective@rendermodeinherited by descendants. - Treat
InteractiveAutocomponents as browser code even when they initially execute on the server; Auto can choose WebAssembly on later visits, so both implementations must enforce the same server data-access policies. - Keep secrets and privileged implementation code outside the
.Clientproject and its dependencies; downloaded assemblies,wwwrootconfiguration, and embedded resources are readable and modifiable by the user. - Minimize parameters crossing a static-to-interactive boundary: WebAssembly and Auto parameter payloads are browser-readable, while Interactive Server descriptors use Data Protection. Neither encryption nor
prerender: falseprotects data that the component renders into HTML or later sends to the browser. - Use the cascading
HttpContextduring static SSR for request-bound work; obtain interactive server identity fromAuthenticationStateProvider. Do not authorize through a capturedHttpContextorIHttpContextAccessor, which can be absent or retain a stale principal