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
Justification="This is a best-effort scan for [ServiceKey] across all constructors and properties, including non-public ones. Autofac's trim/AOT contract preserves only public constructors and properties (see ActivatorMemberTypes); if a non-public member is trimmed away, it simply is not found here, which matches the documented behavior that non-public activation is not trim/AOT-safe. No public member that drives activation is missed.")]
Justification="GetRuntimeProperties enumerates non-public properties as well, but Autofac's trim/AOT contract preserves only public properties (see ActivatorMemberTypes). The injectable set is filtered down to required members and explicitly-configured properties; non-public properties that the trimmer removes are not part of the supported (public) property-injection surface.")]
/// Centralizes the <see cref="DiagnosticSource.Write(string, object?)"/> call so the
144
+
/// trimming/AOT suppression for it lives in exactly one place.
145
+
/// </summary>
146
+
/// <remarks>
147
+
/// <see cref="DiagnosticSource.Write(string, object?)"/> is annotated
148
+
/// <c>[RequiresUnreferencedCode]</c> because a listener may reflect over the
149
+
/// anonymously-typed payload. Autofac's diagnostics are opt-in: this code path only
150
+
/// runs when a caller has explicitly attached a <see cref="DiagnosticListener"/>
151
+
/// subscriber, which is a development/observability scenario rather than part of the
152
+
/// core resolve behavior. The payload types are concrete, internal
153
+
/// <c>*DiagnosticData</c> classes that are always referenced from this assembly, so they
154
+
/// are not trimmed away. Suppressing here keeps the resolve pipeline (which calls these
155
+
/// methods) free of trim warnings.
156
+
/// </remarks>
157
+
[UnconditionalSuppressMessage(
158
+
"Trimming",
159
+
"IL2026:RequiresUnreferencedCode",
160
+
Justification="Diagnostics are opt-in and only run when a DiagnosticListener subscriber is attached. Payload types are concrete internal types referenced from this assembly and are not trimmed.")]
0 commit comments