Udostępnij za pośrednictwem


Attribute '<attributename>' cannot be applied to '<membername>' because the attribute is not valid on this declaration type

The attribute you are using is not appropriate for the item you are using.

Error ID: BC30662

To correct this error

  1. Choose an attribute that is intended for the item you are using. For example, if you are using method, choose an attribute designed to be used with methods.

  2. If you are using custom attributes that you developed, change the AttributeUsage attribute to match the kind of item you are using.

See Also

Reference

AttributeUsageAttribute

Other Resources

Attributes in Visual Basic

Custom Attributes in Visual Basic