Skip to content

Conversation

@josalem
Copy link
Contributor

@josalem josalem commented Aug 25, 2021

Fixes #57709

If a class, such as SqlLiteCommand, has a shadowed property name, such as SqlLiteCommand.Connection and DbCommand.Connection, the logic in DiagnosticSourceEventSource will throw an ambiguous match exception when trying to resolve a property with that name.

This patch adds a fast path for most use cases that will only check the declared properties on the given type and won't fall back to the looping logic unless it needs to.

This should be ported to 6.0-rc2 if approved.

@josalem josalem added this to the 6.0.0 milestone Aug 25, 2021
@josalem josalem requested review from davmason and tarekgh August 25, 2021 23:26
@josalem josalem self-assigned this Aug 25, 2021
@ghost
Copy link

ghost commented Aug 25, 2021

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

Issue Details

Fixes #57709

If a class, such as SqlLiteCommand, has a shadowed property name, such as SqlLiteCommand.Connection and DbCommand.Connection, the logic in DiagnosticSourceEventSource will throw an ambiguous match exception when trying to resolve a property with that name.

This patch adds a fast path for most use cases that will only check the declared properties on the given type and won't fall back to the looping logic unless it needs to.

This should be ported to 6.0-rc2 if approved.

Author: josalem
Assignees: josalem
Labels:

area-System.Diagnostics

Milestone: 6.0.0

@josalem josalem merged commit a026b1d into dotnet:main Aug 26, 2021
@josalem josalem deleted the dev/josalem/diagsource-reflection branch August 26, 2021 20:13
@josalem
Copy link
Contributor Author

josalem commented Aug 26, 2021

/backport to release/6.0

@josalem
Copy link
Contributor Author

josalem commented Aug 26, 2021

/backport to release/6.0

@github-actions
Copy link
Contributor

@ghost ghost locked as resolved and limited conversation to collaborators Sep 25, 2021
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.

Collecting database events from a .NET 6 application causes it to crash

4 participants