blazorblazor-webassemblyradzen

Radzen Blazor components only run after full rebuild


I am trying out the Radzen Blazor components in a test project. If I do a full rebuild of the project and run it then everything works correctly. If I close the browser and immediately run again (outside debug) it fails with the error.

Unhandled exception rendering component: Cannot provide a value for property 'Service' on type 'Radzen.Blazor.RadzenContextMenu'. There is no registered service of type 'Radzen.ContextMenuService'.

If I do a full rebuild again, without changing any code, it will again work one time then fail.

Is there something I have to register to use Radzen? The website doesn't say anything about registration.


Solution

  • Try to register the service in error message

    builder.Services.AddScoped<Radzen.ContextMenuService>();

    If the error still occurs,please share a minimal example that could reproduce your issue