Radzen.DialogService.OpenAsync Null Reference Exception #1733

Closed
opened 2026-01-29 17:57:51 +00:00 by claunia · 1 comment
Owner

Originally created by @groogiam on GitHub (Apr 22, 2025).

Describe the bug
DialogService.OpenAsync fails with null reference exception.

To Reproduce
Steps to reproduce the behavior:

  1. The following code fails with the below error
DialogOptions DefaultDialogOptions = new()
    {
        Width = "100%",
        Height = "100%",
        CloseDialogOnEsc = true,
        ShowClose = true
    };

DialogService.OpenAsync(component.DisplayName, component.ComponentType,
            component.ComponentParameters, DefaultDialogOptions);
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Radzen.DialogService.OpenAsync(String title, Type componentType, Dictionary`2 parameters, DialogOptions options)

Alternatively link your repo with a sample project that can be run.

Expected behavior
OpenAsync should not throw.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser chrome
  • Version Radzen.Blazor 6.6.1

Additional context
Add any other context about the problem here.

Originally created by @groogiam on GitHub (Apr 22, 2025). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** DialogService.OpenAsync fails with null reference exception. **To Reproduce** Steps to reproduce the behavior: 1. The following code fails with the below error ```csharp DialogOptions DefaultDialogOptions = new() { Width = "100%", Height = "100%", CloseDialogOnEsc = true, ShowClose = true }; DialogService.OpenAsync(component.DisplayName, component.ComponentType, component.ComponentParameters, DefaultDialogOptions); ``` ``` crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Radzen.DialogService.OpenAsync(String title, Type componentType, Dictionary`2 parameters, DialogOptions options) ``` Alternatively link your repo with a sample project that can be run. **Expected behavior** OpenAsync should not throw. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: Windows 11 - Browser chrome - Version Radzen.Blazor 6.6.1 **Additional context** Add any other context about the problem here.
Author
Owner

@groogiam commented on GitHub (Apr 22, 2025):

I think I see the issue. These overloads for OpenAsync and Open both reflectively call 'OpenDialog'. The binding flags assume this method is public

bc7b0a9bdb/Radzen.Blazor/DialogService.cs (L145)

but in 3fd3916ef9 OpenDialog was made internal.

@groogiam commented on GitHub (Apr 22, 2025): I think I see the issue. These overloads for `OpenAsync` and `Open` both reflectively call 'OpenDialog'. The binding flags assume this method is public https://github.com/radzenhq/radzen-blazor/blob/bc7b0a9bdb36a40eee92a1a4741e307ac86dd601/Radzen.Blazor/DialogService.cs#L145 but in https://github.com/radzenhq/radzen-blazor/commit/3fd3916ef92df6917fd2e89a31f4f7293fccd13f `OpenDialog` was made internal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1733