tags:

views:

170

answers:

1

For example:

Public Event CurrentChanged As EventHandler(Of CurrentChangedEventArgs(Of T))

Shows the message "Do not nest generic types in member signatures." on CurrentChangedEvent, which is the variable that holds the delegate for the event, and VB generates it automagically.

How do I suppress the rule for the item?

+1  A: 

You can enter the exception as a module-level SuppressMessage attribute.

<Module: SuppressMessage("Microsoft.Naming", _
                         "CA1717:OnlyFlagsEnumsShouldHavePluralNames", _
                         Scope := "type", _
                         Target := "CardGame.Suits")>

If you are using the FxCop GUI, you can have it copy the SuppressMessageAttribute declaration to the clipboard from the right-click menu of the issue: Copy As | Module-level SuppressMessage. Be warned, however, this may get you C# syntax which needs a little light housekeeping to convert to VB.Net syntax.

Jeffrey Hantin
Hey I didn't knew I could copy the de suppress message declaration! Thanks! I imagine there is no way to get the vb code though.
Wilhelm