Skip to content

[LSG] warning CS8785: Generator 'LoggerMessageGenerator' failed to generate source. #77525

Description

@pengweiqhca

Description

LoggerMessageGenerator not support [Obsolete] with argment(s).

Reproduction Steps

public static partial class LoggerExtensions
{
	[LoggerMessage((int)LogLevel.Trace, LogLevel.Trace, "{Msg}")]
	[Obsolete("test")]
	public static partial void Trace(this ILogger logger, string msg, Exception? ex = null);
}

Expected behavior

Not error.

Actual behavior

warning CS8785: Generator 'LoggerMessageGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidCastException' with message 'Specified cast is not valid.'

Regression?

No response

Known Workarounds

Delete [Obsolete] argment.

Configuration

No response

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions