Skip to content

Logging.EventSource tests failing on iOS with NullReferenceException in OnEventWritten #127449

Description

@github-actions

Description

Microsoft.Extensions.Logging.EventSource.Tests failing on iOS and likely all mobile platforms with NullReferenceExceptions in EventSource.OnEventWritten.

Failure Pattern

All 8 failing tests report:

ERROR: Exception during EventSource.OnEventWritten: Object reference not set to an instance of an object.
Assert.Collection() Failure: Item comparison failure
Error: Event name does not match. Expected Message, event data is '{"__EVENT_NAME":"EventSourceMessage","message":"ERROR: Exception during EventSource.OnEventWritten: Object reference not set to an instance of an object."}'

Failing Tests

  1. Logs_OnlyMessage_IfKeywordSet
  2. Logs_TracingDetailsAsExpected_WithDefaults (4 theory variants)
  3. Logs_OnlyFormattedMessage_IfKeywordSet
  4. Logs_AsExpected_WithDefaults
  5. Logs_AsExpected_WithDefaults_EnabledEarly

Platform Coverage

Confirmed on:

  • iossimulator-arm64 CoreCLR

Likely affects all mobile platforms (tvOS, MacCatalyst, Android) based on failure pattern.

Failure Details

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1397424
Date: 2026-04-27

Helix Job: 7da59944-242f-4296-8a21-1a36fe1d0562
Work Item: Microsoft.Extensions.Logging.EventSource.Tests

Console log shows the EventSource implementation itself is throwing a NullReferenceException during event writing, not the test code.

Related

Likely related to recent changes around trimming, reflection, or EventSource handling on mobile/NativeAOT platforms. See also #127448 for concurrent DI/Hosting failures on the same build.

Note

🔒 Integrity filter blocked 3 items

The following items were blocked because they don't meet the GitHub integrity level.

  • #126023 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #124461 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #108513 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Mobile Platform Failure Scanner · ● 4.2M · ◷

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions