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

DiagnosticSource does not get properties in base class #41300

Closed
0b01 opened this issue Aug 24, 2020 · 1 comment · Fixed by #55613
Closed

DiagnosticSource does not get properties in base class #41300

0b01 opened this issue Aug 24, 2020 · 1 comment · Fixed by #55613

Comments

@0b01
Copy link

0b01 commented Aug 24, 2020

Description

In FilterAndPayloadSpecs, TransformSpec can only access payload properties declared in the current class but not in base class.

Configuration

Regression?

Other information

Proposed fix:

Change DeclaredProperties and GetDeclaredProperty to enable access to declared and inherited properties in current class and base class.

PropertyInfo? propertyInfo = typeInfo.GetDeclaredProperty(propertyName);

foreach (PropertyInfo property in curTypeInfo.DeclaredProperties)

https://stackoverflow.com/questions/35370384/how-to-get-declared-and-inherited-members-from-typeinfo

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Diagnostics.Tracing untriaged New issue has not been triaged by the area owner labels Aug 24, 2020
@ghost
Copy link

ghost commented Aug 24, 2020

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

@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label Aug 26, 2020
@tommcdon tommcdon added this to the 6.0.0 milestone Aug 26, 2020
@noahfalk noahfalk added enhancement Product code improvement that does NOT require public API changes/additions and removed enhancement Product code improvement that does NOT require public API changes/additions labels Jan 12, 2021
@noahfalk noahfalk self-assigned this Jan 12, 2021
noahfalk added a commit to noahfalk/runtime that referenced this issue Jul 14, 2021
Fixes dotnet#41300

Previously DiagnosticSourceEventSource would only iterate and recognize properties that were declared on the most derived type.
Now it can capture properties that were inherited from a base class too.
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 14, 2021
stephentoub pushed a commit that referenced this issue Jul 14, 2021
Fixes #41300

Previously DiagnosticSourceEventSource would only iterate and recognize properties that were declared on the most derived type.
Now it can capture properties that were inherited from a base class too.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants