Skip to content

Commit

Permalink
[code-docs] document TypeAttributes.Serializable in DuckTyping (#3840)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek authored Dec 2, 2024
1 parent 838e65e commit d0729fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/OpenTelemetry.AutoInstrumentation/DuckTyping/DuckType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ private static ModuleBuilder CreateTypeAndModuleBuilder(Type typeToDeriveFrom, T
parentType = typeof(ValueType);
typeAttributes = TypeAttributes.Public | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit | TypeAttributes.SequentialLayout | TypeAttributes.Sealed
#pragma warning disable SYSLIB0050
// TODO verify how to handle TypeAttributes.Serializable which is obsolete.
// It was working fine with binaries compiled against .NET6 executed in .NET8 runtime.
// TypeAttributes.Serializable is obsolete. There is a recommendation to keep code as is.
// to mitigate potential unknown issues.
// Historically, t was working fine with binaries compiled against .NET6 executed in .NET8 runtime.
// https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/3799
| TypeAttributes.Serializable;
#pragma warning restore SYSLIB0050
Expand Down

0 comments on commit d0729fa

Please sign in to comment.