Open afuersch opened 4 months ago
We have the same problem with dotnet format :(
same problem, workaround is to reference component with its full namespace instead of the using keyword. Hope this problem will be fixed soon.
The issue still exists with SDK 8.0.202
Since dotnet format has moved to the dotnet SDK repository I created the issue there to hope for more feedback.
Since the .NET SDK update to version
8.0.200
it seems that the format tool doesn't link the Razor pages with their code behind files anymore.We use code behind files
*.razor.cs
for our Razor components. Using the format tool now leads to aIDE0051
unused private member warning. Looks like the Razor code does not exist for the tool.I've created a repository with the sample Blazor WASM application and moved the C# code of
Counter.razor
andWeather.razor
to a code-behind file to demonstrate the issue.E.g. the verify no style changes command brings up
IDE0051
error and says that the Click event handler defined in the code behind file is unused.Running
dotnet format
formats theCounter.razor.cs
file and removes theIncrementCount()
method.The automatically removed method leads to a failed build.
Environment
.NET
dotnet format