-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ProvideCorrectArgumentsToFormattingMethodsAnalyzer throws IndexOutOfRangeException when building Microsoft.Extensions.Logging.Abstractions #90357
Comments
Tagging subscribers to this area: @dotnet/area-extensions-logging Issue DetailsDescriptionWhen building Microsoft.Extensions.Logging.Abstractions I see the diagnostic
I'll suppress this when enabling AD0001 as warning. This issue will track fixing that analyzer and removing the warning suppression Reproduction StepsRemove AD0001 from Microsoft.Extensions.Logging.Abstractions.csproj and build it. Expected behaviorBuilds without warning. Actual behaviorWarning as above Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
I have investigated this and found this is issue in the analyzer that not handling the case when using a method with StringSyntaxAttribute parameter and not having any other parameters. CompositeFormat.Parse is an example of that. And The actual line throwing IndexOutOfRangeException is https://github.com/dotnet/roslyn-analyzers/blob/7e4877c40535652d7d44a238ea48b03f47f63e29/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/ProvideCorrectArgumentsToFormattingMethods.cs#L428C18-L428C18. We already have a PR dotnet/roslyn-analyzers#6885 for fixing the analyzer. @buyaa-n as we talked offline, you are going to follow up with the analyzer PR and then flow the fix to the runtime repo with removing the warning suppression in the project. Please ensure porting the fixes to 8.0 release branch. Thanks! |
Tagging subscribers to this area: @dotnet/area-meta Issue DetailsDescriptionWhen building Microsoft.Extensions.Logging.Abstractions I see the diagnostic
I'll suppress this when enabling AD0001 as warning. This issue will track fixing that analyzer and removing the warning suppression Reproduction StepsRemove AD0001 from Microsoft.Extensions.Logging.Abstractions.csproj and build it. Expected behaviorBuilds without warning. Actual behaviorWarning as above Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Thanks for finding the root cause of the issue @tarekgh ! |
Description
When building Microsoft.Extensions.Logging.Abstractions I see the diagnostic
I'll suppress this when enabling AD0001 as warning. This issue will track fixing that analyzer and removing the warning suppression
Reproduction Steps
Remove AD0001 from Microsoft.Extensions.Logging.Abstractions.csproj and build it.
Expected behavior
Builds without warning.
Actual behavior
Warning as above
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: