We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NServiceBus 8.1.1 included replacing SimpleJson with System.Text.Json in the HostStartupDiagnosticsWriter class.
However, System.Text.Json does not support System.Type serialization out of the box, due to security concerns. At least one transport (there may be others) includes a System.Type property in a startup diagnostic entry, which causes serialization of startup diagnostics to fail.
This behavior can be reproduced by enabling delayed delivery in the Simple MSMQ Transport usage sample.
2023-08-21 12:32:59.899 ERROR Failed to serialize startup diagnostics System.NotSupportedException: Serialization and deserialization of 'System.Type' instances are not supported. Path: $.TimeoutStorageType. ---> System.NotSupportedException: Serialization and deserialization of 'System.Type' instances are not supported. at System.Text.Json.Serialization.Converters.UnsupportedTypeConverter`1.Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.TryWriteAsObject(Utf8JsonWriter writer, Object value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Converters.DictionaryOfTKeyTValueConverter`3.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryWrite(Utf8JsonWriter writer, TDictionary dictionary, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1.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.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.JsonSerializer.WriteCore[TValue](Utf8JsonWriter writer, TValue& value, JsonTypeInfo`1 jsonTypeInfo) at System.Text.Json.JsonSerializer.WriteString[TValue](TValue& value, JsonTypeInfo`1 jsonTypeInfo) at NServiceBus.HostStartupDiagnosticsWriter.<Write>d__1.MoveNext() in /_/src/NServiceBus.Core/Hosting/StartupDiagnostics/HostStartupDiagnosticsWriter.cs:line 30
Startup diagnostics file is not generated
Users of both NServiceBus 8.1.1 and the MSMQ transport with delayed delivery enabled
The MSMQ transport includes a System.Type property as part of a diagnostics entry which the System.Text.Json serializer does not support.
System.Type
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
Description
NServiceBus 8.1.1 included replacing SimpleJson with System.Text.Json in the HostStartupDiagnosticsWriter class.
However, System.Text.Json does not support System.Type serialization out of the box, due to security concerns. At least one transport (there may be others) includes a System.Type property in a startup diagnostic entry, which causes serialization of startup diagnostics to fail.
Steps to reproduce
This behavior can be reproduced by enabling delayed delivery in the Simple MSMQ Transport usage sample.
Relevant log output
Symptoms
Startup diagnostics file is not generated
Who's affected
Users of both NServiceBus 8.1.1 and the MSMQ transport with delayed delivery enabled
Root cause
The MSMQ transport includes a
System.Type
property as part of a diagnostics entry which the System.Text.Json serializer does not support.Backported
The text was updated successfully, but these errors were encountered: