Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable EventSource support in NativeAOT by default #76000

Merged
merged 3 commits into from
Sep 23, 2022

Commits on Sep 22, 2022

  1. Disable EventSource support in NativeAOT by default

    `DiagnosticSource` is currently not AOT compatible. If a machine-wide DiagnosticSource-related event listener is enabled (such as PerfView, or possibly even a managed VS debugging session) it activates `DiagnosticSource` code paths within the executable and basically injects a runtime failure into NativeAOT processes due to the AOT-incompatibility of the code.
    
    E.g. trying to do a `HttpClient` web request with PerfView collecting in the background causes a runtime exception to be thrown.
    
    This uses the documented switch to disable `EventSource` support (unless the user specified a different value). Indirectly, it disables `DiagnosticSource` as well.
    
    As a side effect, disabling `EventSource` drops the size of a NativeAOT-compiled Hello World from 3.48 MB to 2.85 MB 🥳.
    MichalStrehovsky committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    d6ca709 View commit details
    Browse the repository at this point in the history
  2. Fix tests

    MichalStrehovsky committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    a56d558 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1641ab3 View commit details
    Browse the repository at this point in the history