-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Originally reported by @bradwilson, related to dotnet/roslyn-analyzers#6903
I placed this attribute on a base class:
[ExportCodeFixProvider(LanguageNames.CSharp)]
public abstract class CSharpCodeFixProvider : CodeFixProvider
{
// ...
}And then removed it from the derived classes:
[Shared]
public class ActualFixer : CSharpCodeFixProvider
{
// ...
}Tests using Microsoft.CodeAnalysis.CSharp.CodeFix.Testing now shifted from passing to failing because the fixer did not run.
It appears this attribute does not support inheritance, despite being listed as inheritance being permitted (or perhaps the issue is with the testing library, I'm not sure at this point).
As such, I recommend you mark this attribute as Inherited = false so that developers will know that the mechanism for discovering this attribute does not check inherited classes.