What does the EditorRequired attribute on a [Parameter] enforce, and when is it checked?

Last updated 5 July 2026

  • [EditorRequired] marks a [Parameter] as mandatory, producing compiler warning RZ2012 when it's omitted in Razor markup.

  • It is only checked for markup usage, not for components created dynamically (e.g. via RenderTreeBuilder or reflection).

  • It warns about omission only and does not stop an explicit null, so still validate critical values yourself.

  • https://www.ssw.com.au/rules/editor-required-blazor-component-parameters
  • https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-10.0
  • https://code-maze.com/blazor-webassembly-required-parameters/
  • https://learn.microsoft.com/en-us/aspnet/core/blazor/components/dynamiccomponent?view=aspnetcore-10.0
All Blazor interview questions