.NET WinForms: IntelliSense remark IDE0051 shown for own class methods, but not for Form class methods
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice]
Environment
I have a WinForms-.NET-FX 4.8 VB.NET-project in Visual Studio Version 17.9.0 Preview 4.0 on a 64-bit Win10 PC, but it also happens in a WinForms-.NET 7.0 VB.NET-project.
Problem
The IntelliSense remark IDE0051 for irrrelevant methods are shown for own class methods, but not for Form class methods.
Description
I have the following code:
Friend Class FrmMain
Private Sub Foo()
End Sub
Private Function Bar() As Boolean
Return False
End Function
End Class
Friend Class Foo
Private Sub Bar()
End Sub
Private Function Baz() As Boolean
Return False
End Function
End Class
The result in the IDE:
The methods in the class Foo are marked as unnecessary, so their names are gray instead of black and I see the IDE0051 remark. For the FrmMain class (an inherited class of Windows.Form) the two shown methods are also unnecessary, but they are not marked as this.
Consequences
It’s harder to see, which methods can be deleted. The reference counter is nice, but the IDE0051 remark would be better, especially in combination with the method name being greyed out.
Original Comments
Feedback Bot on 1/29/2024, 06:25 PM:
(private comment, text removed)
Original Solutions
(no solutions)