Skip to content

Fix BL0013 diagnostic location for GetAuthenticationStateAsync - #68451

Open
javiercn wants to merge 1 commit into
mainfrom
fix-bl0013-auth-state-location
Open

Fix BL0013 diagnostic location for GetAuthenticationStateAsync#68451
javiercn wants to merge 1 commit into
mainfrom
fix-bl0013-auth-state-location

Conversation

@javiercn

Copy link
Copy Markdown
Member

Summary

Fix BL0013 to report the actual GetAuthenticationStateAsync() invocation location instead of the component declaration when analyzing generated Razor code.

Validation

  • dotnet test src\Components\Analyzers\test\Microsoft.AspNetCore.Components.Analyzers.Tests.csproj --filter AuthenticationStateProviderAnalyzerTest

Fixes #68339

Copilot AI lite review requested due to automatic review settings August 12, 2026 11:40
@javiercn
javiercn requested a review from a team as a code owner August 12, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

The analyzer was reporting the component declaration instead of the GetAuthenticationStateAsync invocation when no auth-state subscription was present.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1ebba356-ca5d-4068-bb04-476f6f149196
@javiercn
javiercn force-pushed the fix-bl0013-auth-state-location branch from 2c1a36a to 271e9cd Compare August 12, 2026 11:45
@ilonatommy

Copy link
Copy Markdown
Member

@kdinev, could you help with the review here in connection to #67383?

@kdinev

kdinev commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@kdinev, could you help with the review here in connection to #67383?

@ilonatommy @javiercn it's not urgent, is it? I'm currently away.

@javiercn

Copy link
Copy Markdown
Member Author

@kdinev nope.

We are trying to close down on RC1, but maybe can wait a few hours/day. I saw @danroth27 file it as it came up during the P7 demos, and I just tasked copilot on the side to fix it so that we don't miss it.

@kdinev

kdinev commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@kdinev nope.

We are trying to close down on RC1, but maybe can wait a few hours/day. I saw @danroth27 file it as it came up during the P7 demos, and I just tasked copilot on the side to fix it so that we don't miss it.

I'll try to get it reviewed by tomorrow morning. I'm away till the end of next week but I don't want to be delaying the RC.

@ilonatommy ilonatommy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-applying based on @kdinev's approval.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BL0013 highlights unrelated code at the top of Razor files

5 participants