Suppress RZ10012
In my blazor project, I get hundreds of RZ10012 warnings:
Found markup element with unexpected name 'Foo'. If this is intended to be a component, add a @using directive for its namespace.(RZ10012)
This seems to be a bug, going back for years. It's been reported dozens of times on SO and in various GitHub repos. There are no fixes or workarounds that work consistently.
It's impossible to be productive when the entire editor shows squigglies. Since the app itself works, I want to suppress that analyser rule.
So I added this to an .editorconfig in the project's root:
[*.razor]
dotnet_diagnostic.RZ10012.severity = none
That doesn't help. I also tried a .globalconfig file.
How can I suppress it?
(I'm using .net6 and vscode)
@allisonchou: Let's test this with the latest VS Code bits to see if it still repros there.
It happened to me in Visual Studio 17.4 just today (not VS Code). In my case closing VS, deleting obj and bin directories and opening VS again, worked.
For me, the rm -rf ./bin ./obj trick works sometimes, but even so, only for a few builds after which the problem returns. And I need to close and open vscode too.
It happens to me too, it is NOT USABLE AT ALL.
This is a very much urgent issue in my opinion. I simply can not keep coding like this.
Check this screen recording, it starts to blink on and off.
@phil-allen-msft I'm moving this back to triage since users are reporting this repros in both VS and VS Code. The last comment I believe is another instance of the colorization issues we've been seeing recently.
@phil-allen-msft what was the rationale behind making this a compiler issue? Is there some more info somewhere about what’s causing it?
Oh, I see this is about the suppression itself not working. Ok makes sense that that would be us.
I still have the same issue on .NET 8 using C# and Blazor. Suppressing the RZ10012 warning still doesn't work via .editorconfig or the <NoWarn> tag in the .csproj file.