From 3d70d9404be78a4b44bcec01244001db07a0f48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Mon, 2 Dec 2024 07:00:15 +0100 Subject: [PATCH] [code-docs] document TypeAttributes.Serializable in DuckTyping --- src/OpenTelemetry.AutoInstrumentation/DuckTyping/DuckType.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/OpenTelemetry.AutoInstrumentation/DuckTyping/DuckType.cs b/src/OpenTelemetry.AutoInstrumentation/DuckTyping/DuckType.cs index 7e0538d336..1206269588 100644 --- a/src/OpenTelemetry.AutoInstrumentation/DuckTyping/DuckType.cs +++ b/src/OpenTelemetry.AutoInstrumentation/DuckTyping/DuckType.cs @@ -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