Problem with designer in RB4VS

When I try to open my .razor page in designer mode I receive just white blank window. No error, not any other problem, just blank not editable window instead design time razor.

How to fix it?

Hi @Djordje,

Is there anything in the Radzen output window? Go to View -> Radzen Blazor for Visual Studio -> Output

Nothing suspicious:
Starting Radzen.Server on port 4000
Connected to Radzen.Server
Waiting for any pending restore operations...
Restore complete.
Solution is up to date.
Opening project E:\RadzenApp\EcoODS\EcoMatrix.sln
Finished building E:\RadzenApp\EcoODS\EcoMatrix.csproj
Finished building E:\RadzenApp\EcoODS\EcoMatrix.csproj

We are not sure what could cause this problem. You can send us your app to test at info@radzen.com .

My application is too big and I do not want to share it. Just to stress it is fully functional when it is compiled but I tried to edit some components from standalone Radzen Blazor Studio and received this error:
System.InvalidOperationException: Unable to resolve service for type 'Bezra.Data.ApplicationIdentityDbContext' while attempting to activate 'Bezra.SecurityService'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(ServiceIdentifier serviceIdentifier, Type implementationType, CallSiteChain callSiteChain, ParameterInfo parameters, Boolean throwIfCallSiteNotFound)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, ServiceIdentifier serviceIdentifier, Type implementationType, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, Int32 slot)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.AspNetCore.Components.ComponentFactory.<>c__DisplayClass9_0.g__Initialize|1(IServiceProvider serviceProvider, IComponent component)
at Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent(IServiceProvider serviceProvider, Type componentType, IComponentRenderMode callerSpecifiedRenderMode, Nullable1 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, Int32 frameIndex, Int32 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
--- End of stack trace from previous location ---
at Radzen.Server.RemoteRenderer.HandleException(Exception exception)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
at Radzen.Server.Router.Render(Type layout, Type component, Boolean renderLayout)
at Radzen.Server.Router.OnRouteChanged(Object sender, RouteChangedEventArgs e)
at Radzen.Server.RouterService.Route(Type component, Type defaultLayout, Boolean renderLayout)
at Radzen.Server.CircuitHost.AddComponent(Type layout, Type page, Boolean renderLayout)
at Radzen.Server.ProjectServer.Render(String fileName, String source, Boolean renderLayout)
at Radzen.Server.ProgramController.Render(RenderRequest request)

Is this application created by Radzen Blazor Studio or a custom one? Where is the ApplicationidentityDbContext registered? What is your application (Server, WASM, Auto)? What .NET framework version are you using?

Applications generated by Radzen Blazor Studio register the context in Program.cs:

builder.Services.AddDbContext<ApplicationIdentityDbContext>

In any case you can use preprocessor to hide certain code from design-time builds. Not sure if it would help but worth mentioning.

This is .NET9 server application. It is originally created by RBS but during the time there were substantial changes.

builder.Service.AddDbContext is defined through ContextFactory so it is not exactly in Program.cs but this was done more than a year ago. I don't use designer often but I can confirm that a few months ago it was ok.

Unfortunately the provided information doesn’t allow us to reproduce the error. You can try installing an older version if you believe it used to work.

Ok. I admit that this issue needs a deeper investigation. Having said that I made a brand new application directly from the RBS template and could not enter the designer. An error I found is:

E:\RadzenApp\DigiDent\Program.cs(35,24): error CS0246: The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)

I did not touch any character in the template application.

What is the output of running dotnet --info in command prompt? This error happenswhen a newer release candidate version is installed.

This is output from dotnet –info:

Host:
Version: 10.0.0-rc.1.25451.107
Architecture: x64
Commit: 2db1f5ee2b

.NET SDKs installed:
7.0.317 [C:\Program Files\dotnet\sdk]
8.0.101 [C:\Program Files\dotnet\sdk]
9.0.101 [C:\Program Files\dotnet\sdk]
9.0.200 [C:\Program Files\dotnet\sdk]
9.0.305 [C:\Program Files\dotnet\sdk]
10.0.100-rc.1.25451.107 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

but inside folder there is global.json file with this content:
{
"sdk": {
"version": "9.0.305"
}
}

Indeed the global.json file doesn’t always resolve this problem. This is why we do not support preview and release candidate versions of the .NET SDK. We will release a new version with .NET 10 support as soon as Microsoft releases it officially.

Why is Radzen Blazor Studio (RBS) so sensitive to the new .NET version? I didn't intentionally install .NET 10; it seems to have come bundled with the Visual Studio 2026 Preview. This is forcing me to consider setting up a separate PC just for using Radzen tools, which is inconvenient and frankly, unacceptable. Is there a practical way to isolate and manage the specific .NET version required by a project?

Hi @Djordje,

Radzen Blazor Studio uses the dotnet CLI under the hood which is whatever the latest version is.

Yes, this is usually how preview versions get installed. Do you have a particular requirement to use VS 2026 preview? If

Usually global.json is supposed to solve this problem. Even you have reported that it worked in the past: Global.json and .NET preview We are not sure why it doesn’t work with the .NET 10 Preview. Preview versions tend to break a lot of stuff and this is why we refuse to support them.

Ok. I removed VS 2026, accordingly removed .NET10 but I still have following error in RBS:
System.InvalidOperationException: Unable to resolve service for type 'Bezra.Data.ApplicationIdentityDbContext' while attempting to activate 'Bezra.SecurityService'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(ServiceIdentifier serviceIdentifier, Type implementationType, CallSiteChain callSiteChain, ParameterInfo parameters, Boolean throwIfCallSiteNotFound)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, ServiceIdentifier serviceIdentifier, Type implementationType, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain, Int32 slot)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.AspNetCore.Components.ComponentFactory.<>c__DisplayClass9_0.g__Initialize|1(IServiceProvider serviceProvider, IComponent component)
at Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent(IServiceProvider serviceProvider, Type componentType, IComponentRenderMode callerSpecifiedRenderMode, Nullable1 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame(RenderTreeFrame[] frames, Int32 frameIndex, Int32 parentComponentId) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree(DiffContext& diffContext, Int32 frameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame(DiffContext& diffContext, Int32 newFrameIndex) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl) at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff(Renderer renderer, RenderBatchBuilder batchBuilder, Int32 componentId, ArrayRange1 oldTree, ArrayRange`1 newTree)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
--- End of stack trace from previous location ---
at Radzen.Server.RemoteRenderer.HandleException(Exception exception)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
at Radzen.Server.Router.Render(Type layout, Type component, Boolean renderLayout)
at Radzen.Server.Router.OnRouteChanged(Object sender, RouteChangedEventArgs e)
at Radzen.Server.RouterService.Route(Type component, Type defaultLayout, Boolean renderLayout)
at Radzen.Server.CircuitHost.AddComponent(Type layout, Type page, Boolean renderLayout)
at Radzen.Server.ProjectServer.Render(String fileName, String source, Boolean renderLayout)
at Radzen.Server.ProgramController.Render(RenderRequest request)

What next?

That error is unrelated to .NET 10 preview. It is related to how you are registering that DB context and Radzen Blazor Studio not finding its registration for some reason. The only way to assist you further is to somehow reproduce the problem it in a sample application. If you think this is a new issue you can download an older version from here - knowing the latest working version would also help.

Here is a sample app created from the CRM template. I’ve modified the SecurityService to inject the ApplicationIdentityDbContext

public partial class SecurityService
{
    private readonly ApplicationIdentityDbContext dbContext;

    public SecurityService(NavigationManager navigationManager, IHttpClientFactory factory, ApplicationIdentityDbContext dbContext)
    {
        this.baseUri = new Uri($"{navigationManager.BaseUri}odata/Identity/");
        this.httpClient = factory.CreateClient("CRMApp");
        this.navigationManager = navigationManager;
        this.dbContext = dbContext;
    }

Does this app work in design time for you? If yes - how is it different than your real app when it comes to ApplicationIdentityDbContext registration?

Thank you for your patience. I reconfigured my Program.cs and now the designer is working as I expected. Just to clarify what I have done, I’ve got inside Program.cs method where I define version of authentication (ASP.NET Core Identity or SSO SAML2), as I need to use ASP.NET Core Identity after authentication for authorization inside application I put ```builder.Services.AddDbContext```
inside this method. I exclude only this from that method and return it to the main part of Program.cs and now it works.