-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[LSG] warning CS8785: Generator 'LoggerMessageGenerator' failed to generate source. #77525
Comments
Tagging subscribers to this area: @dotnet/area-extensions-logging Issue DetailsDescriptionLoggerMessageGenerator not support [Obsolete] with parameter. Reproduction Stepspublic 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 behaviorNot error. Actual behaviorwarning 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 WorkaroundsDelete [Obsolete] parameter. ConfigurationNo response Other informationNo response
|
Thanks for the report. Would you be interested to offer a PR? |
@allantargino Sorray, I test again, dotnet sdk 7.0.100, |
@allantargino @pengweiqhca how this is important to port to 6.0? We have a servicing bar which needs some justification to port it. I am seeing there is an easy workaround to reference 7.0 version of the logging libraries. right? |
This issue has been marked |
I have solved in other way. But I think it's a compatibility issue, and .NET 6 still servicing. |
@tarekgh I'd say this isn't a critical fix. Like you said, the workaround is just to reference the new version. Given it doesn't have any breaking changes, I believe it is fair to not port it back. |
Per the replies I am going to close this issue and the PR and we can consider the porting to 6.0 if we see more demands on it in the future. |
Description
LoggerMessageGenerator not support [Obsolete] with argment(s).
Reproduction Steps
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
The text was updated successfully, but these errors were encountered: