System.NotSupportedException when using DialogService

I'm getting a strange error where as the DialogService is called, I get this error

System.NotSupportedException: 'Serialization and deserialization of 'Microsoft.AspNetCore.Components.RenderFragment1[[Radzen.DialogService, Radzen.Blazor, Version=3.19.10.0, Culture=neutral, PublicKeyToken=null]]' instances are not supported. The unsupported member type is located on type 'Microsoft.AspNetCore.Components.RenderFragment1[Radzen.DialogService]'. Path: $.ChildContent.'

and when I hit continue in Visual Studio's debugging, it just keeps going as if nothing happened, the dialog works as intended after that.

I'm not sure what is causing this, I have triple checked that all the required lines of code mentioned in Getting Started are in correctly and this error doesn't occur in another project.

Unfortunately we haven't seen such error before and we don't know what might cause it.

I've got the same error. After some experimentations found the workaround. In my case the dialog was initially passed as a render fragment method parameter. Moved this fragment "as-is" to the separate component file and made it a type parameter. Error has gone. Not sure what was the real root of the problem, but hope it helps...

---> System.NotSupportedException: Serialization and deserialization of 'Microsoft.AspNetCore.Components.RenderFragment1[[Radzen.DialogService, Radzen.Blazor, Version=4.2.2.0, Culture=neutral, PublicKeyToken=null]]' instances are not supported. The unsupported member type is located on type 'Microsoft.AspNetCore.Components.RenderFragment1[Radzen.DialogService]'. Path: $.ChildContent.
---> System.NotSupportedException: Serialization and deserialization of 'Microsoft.AspNetCore.Components.RenderFragment1[[Radzen.DialogService, Radzen.Blazor, Version=4.2.2.0, Culture=neutral, PublicKeyToken=null]]' instances are not supported. at System.Text.Json.Serialization.Converters.UnsupportedTypeConverter1.Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter1.TryWriteAsObject(Utf8JsonWriter writer, Object value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.Converters.ArrayConverter2.OnWriteResume(Utf8JsonWriter writer, TElement[] array, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ThrowNotSupportedException(WriteStack& state, NotSupportedException ex)
at System.Text.Json.Serialization.JsonConverter1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.JsonSerializer.WriteUsingSerializer[TValue](Utf8JsonWriter writer, TValue& value, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.WriteStringUsingSerializer[TValue](TValue& value, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.Serialize[TValue](TValue value, JsonSerializerOptions options) at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args) at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args) at Radzen.Blazor.RadzenDialog.Open(String title, Type type, Dictionary2 parameters, DialogOptions options)
--- End of inner exception stack trace ---