Skip to content

[release/7.0] Fix DiagnosticSource to work with NativeAOT (#76109) - #78372

Closed
MichalStrehovsky wants to merge 1 commit into
dotnet:release/7.0from
MichalStrehovsky:backport76109
Closed

MichalStrehovsky wants to merge 1 commit into
dotnet:release/7.0from
MichalStrehovsky:backport76109

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member
git cherry-pick 70b33f8f69128eeb1463691e24646987b54a0e3d

* Fix DiagnosticSource to work with NativeAOT

There were 2 problems:

1. The use of MakeGenericType doesn't work when a property is a ValueType.
An app will crash when a listener is enabled and DiagnosticSourceEventSource tries
writing values.
2. The properties on KeyValuePair were not being preserved correctly, so the Arguments
of the DiagnosticSourceEventSource methods were not being serialized correctly.

Add test (and infrastructure) to ensure DiagnosticSource works in a NativeAOT app

Fix dotnet#75945

* Enable new NativeAotTests in CI

- Only run them in Release configuration
- Suppress IL2026 warning

* Don't run NativeAot published app tests on OSX since it isn't supported

Set EventSourceSupport only on the projects that need it.
@ghost

ghost commented Nov 15, 2022

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost

ghost commented Nov 15, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti
See info in area-owners.md if you want to be subscribed.

Issue Details
git cherry-pick 70b33f8f69128eeb1463691e24646987b54a0e3d
Author: MichalStrehovsky
Assignees: MichalStrehovsky
Labels:

area-System.Diagnostics.Tracing, new-api-needs-documentation

Milestone: -

@tommcdon

Copy link
Copy Markdown
Member

@noahfalk

@carlossanlop

Copy link
Copy Markdown
Contributor

@MichalStrehovsky please fill out the template and request approval from @jeffschwMSFT. Once approved, please send an email to Tactics requesting approval and add the servicing-consider label. The branch is closed for changes for the December release, so this will have to go into the January release.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

Going to use the other: PR #76109 (comment)

@MichalStrehovsky
MichalStrehovsky deleted the backport76109 branch November 18, 2022 01:29
@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants