Hello,
I am experiencing an issue when Radzen Studio tries to render my custom MainLayout in design‑time preview. The application itself runs correctly in the browser, but Radzen Preview fails with the following exception:
System.InvalidOperationException: Cannot provide a value for property 'DialogService' on type 'EventsApproval.Components.Layout.MainLayout'. There is no registered service of type 'Radzen.DialogService'.
at Microsoft.AspNetCore.Components.ComponentFactory...
at Radzen.Server.RemoteRenderer.HandleException(Exception exception)
at Radzen.Server.Router.Render(Type layout, Type component, Boolean renderLayout)
at Radzen.Server.ProjectServer.Render(String fileName, String source, Boolean renderLayout)
In my actual Blazor Server application, all Radzen services are correctly registered in Program.cs:
builder.Services.AddScoped<DialogService>();
builder.Services.AddScoped<TooltipService>();
builder.Services.AddScoped<ContextMenuService>();
builder.Services.AddScoped<NotificationService>();
The application works without any errors when running normally. The problem occurs only inside Radzen Studio, which appears to use its own DI container and does not register Radzen services or localization services required by my layout.
As a result, Radzen Preview cannot instantiate my layout component and throws the exception above.
Could you please advise:
-
How to configure Radzen Studio so that design‑time rendering uses the same DI services as the actual application?
-
Or how to disable design‑time rendering for specific components/layouts to avoid these errors?
Thank you in advance.
