Skip to content

EventSource.GetGuid can differ from EventSource.Guid #1360

@noahfalk

Description

@noahfalk

If you write an EventSource that specifies a name dynamically in the constructor but does not provide the name statically in an EventSource attribute then GetGuid(Type) and the Guid property will compute different values. The GetGuid(Type) return value no longer correlates to the GUID used to register the EventSource with ETW. Although it is intended that users will provide the EventSourceAttribute in this scenario nothing enforces that they do so.

I don't see any obvious way to change the API design to mitigate this issue without also introducing the potential for compat problems, but at minimum we should make the requirements clear in the docs, such as where GetGuid() is described and on the constructors that take a string name.

Metadata

Metadata

Assignees

Labels

area-Tracing-coreclrdocumentationDocumentation bug or enhancement, does not impact product or test code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions