Poyo
Poyo
CC#
Created by Poyo on 2/17/2023 in #help
✅ DiagnosticSuppressors and Visual Studio
In my .NET 7 project I have implemented a dependency injection framework that uses an attribute to load cached dependencies into a private method. However, code analysis does not know that the attribute indicates that the method will be implicitly used and will flag it as unused (IDE0051). I have written a DiagnosticSuppressor that in theory should suppress that warning if the method in question is tagged with my custom attribute, but it doesn't do anything just existing in my project. Is there something I need to do to hook it up to Visual Studio?
19 replies