Skip to content

False positive for SYSLIB1006 when user haven't specified EventID #72263

Closed
@maxkoshevoi

Description

@maxkoshevoi

Description

Related to discussion in #70147 (reply in thread)
CC: @davidfowl

SYSLIB1006 warning states that multiple logging methods cannot use the same event ID.

But it also fires when EventID isn't specified at all. I've annotated my methods without event id:

[LoggerMessage(Level = LogLevel.Information, Message = "Hi there")]
...
[LoggerMessage(Level = LogLevel.Information, Message = "Hi there2")]

and still get a SYSLIB1006 warning.
image

Reproduction Steps

Shown above

Expected behavior

No warning or at least lower severity event

Actual behavior

Warning which fails the build (since we have Treat warnings as errors enabled)

Regression?

No

Known Workarounds

Disable the warning

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions