dotnet / dotnet/aspnetcore

[Blazor] Analyzer for detecting basic cycles in Layout components

Open
#63,519 1 comment 1 reaction 1 assignee Assigned to @Copilot View on GitHub
analyzer area-blazor copilot-candidate
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

If you put a `@Layout MyLayout` directive inside an `_Imports.razor` and `MyLayout.razor` is defined in a subfolder of that folder, you end up with something like this:

```
[Layout(MyLayout)]
public class MyLayout : LayoutBase
{
}
```

Creating an infinite rendering loop. We don't want to anything at runtime, but we can do something at compile time to detect this scenario.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.