-
Couldn't load subscription status.
- Fork 2
Open
Description
Hi, when trying to use the LaunchDarkly.ServerSdk library, which brings in code from this repository and trying to publish my app using ahead of time compilation I am running into some trim analysis warnings from this repo. The following are the errors that I believe pertain to code in this repo:
Trim analysis warning IL2026: LaunchDarkly.Sdk.Internal.Events.EventProcessorInternal.<SendDiagnosticEventAsync>d__32.MoveNext(): Using member 'System.Text.Json.JsonSerializer.SerializeToUtf8Bytes<LdValue>(LdValue,JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.
AOT analysis warning IL3050: LaunchDarkly.Sdk.Internal.Events.EventProcessorInternal.<SendDiagnosticEventAsync>d__32.MoveNext(): Using member 'System.Text.Json.JsonSerializer.SerializeToUtf8Bytes<LdValue>(LdValue,JsonSerializerOptions)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.
These are basically the same error pointing at this code:
dotnet-sdk-internal/src/LaunchDarkly.InternalSdk/Events/EventProcessorInternal.cs
Line 460 in 4e49cb4
| var jsonDiagnostic = JsonSerializer.SerializeToUtf8Bytes(diagnostic.JsonValue); |
Would a PR to help fix these warnings and a test suite to help ensure no future issues be welcomed?
Metadata
Metadata
Assignees
Labels
No labels