KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Resharper warns me when parts of my code are never used; this is very helpful. However, I have quite a few classes that are not referenced by other code directly. These classes are used in the dependency injection (DI) configuration only. I use spring.net for DI. The DI configuration is in xml format. Is there any way I can tell Resharper to use the DI files for the inspection of unused classes? I know I can suppress the Resharper warning using something like: // ReSharper disable UnusedMember.Global public class TheClass : IInterfaceWiredUsingSpringDI // ReSharper restore UnusedMember.Global But I don't like this very much - it's difficult to read and I don't really want to suppress the warning. Note: There is a less obtrusive and more readable way to suppress the warning, which I found on the jetbrains forum . When you define this custom attribute: [MeansImplicitUse] public class IoCAttribute : Attribute { } Then you can suppress the warning: [IoC] public class TheClass : IInterfaceWiredUsingSpringDI
Tags (comma-separated)
Save Edits
Cancel