Skip to main content
Source: Al0096EnableEventSourceSupportAnalyzer.cs

Description

Native AOT trims EventSource by default. If your application uses OpenTelemetry or other EventSource-based diagnostics, you must enable EventSourceSupport in the project file.

Bad Code

<PublishAot>true</PublishAot>
<!-- EventSourceSupport not set, EventSource is trimmed -->

Good Code

<PublishAot>true</PublishAot>
<EventSourceSupport>true</EventSourceSupport>

Properties

  • Category: Configuration
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0096.severity = warning