You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blazor components using a "partial class" for its code rather than a @code block on the razor page itself is getting this warning on every "partial class". Blazor components are restricted to being public, which means this warning cannot be resolved.
Can be easily replicated with the .NET 8 Blazor Web App template.
Add the following to the project file:
CA1515: Consider making public types internal
Blazor components using a "partial class" for its code rather than a
@code
block on the razor page itself is getting this warning on every "partial class". Blazor components are restricted to being public, which means this warning cannot be resolved.Can be easily replicated with the .NET 8 Blazor Web App template.
Add the following to the project file:
Then create a file named "Counter.razor.cs" in the pages folder and add the following code to it:
Then remove the
@code
block from the "Counter.razor" file.Warning CA1515 will now appear on "Counter.razor.cs", which is a false positive. That partial class cannot be internal due to Blazor restrictions.
The text was updated successfully, but these errors were encountered: