You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AOT analysis warning IL3050: OpenTelemetry.Logs.LoggerProviderServiceCollectionBuilder.Build(): Using member 'Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection,Boolean)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Using Microsoft.Extensions.DependencyInjection requires generating code dynamically at runtime. For example, when using enumerable and generic ValueType services.
It looks like in .NET 7 RequiresDynamicCodeAttribute was added: dotnet/runtime#73829
My take after reading the runtime issues is for Microsoft.Extensions.DependencyInjection...
<= .NET 6, no AoT warning. Probably safe. Only requires dynamic code for edge cases.
== .NET 7, AoT warning always.
>= .NET 8, no AoT warning unless dynamic code is actually used.
It seems like the best thing to do would be to upgrade to Microsoft.Extensions.DependencyInjection v8 when it is released but that is probably going to be problematic for auto-instrumentation and people wrapping OTel SDK into other libraries.
Opening this issue for tracking.
The text was updated successfully, but these errors were encountered:
Relates to #3429
On #4441 I added some code which calls...
Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider
...which generated a trim warning...
It looks like in .NET 7
RequiresDynamicCodeAttribute
was added: dotnet/runtime#73829And then it was removed in .NET 8: dotnet/runtime#79286
My take after reading the runtime issues is for
Microsoft.Extensions.DependencyInjection
...It seems like the best thing to do would be to upgrade to
Microsoft.Extensions.DependencyInjection
v8 when it is released but that is probably going to be problematic for auto-instrumentation and people wrapping OTel SDK into other libraries.Opening this issue for tracking.
The text was updated successfully, but these errors were encountered: