Share via


Attribute '<attributename>' cannot be applied to a method with optional parameters

The attribute can only be used with methods that use required arguments or no arguments.

Error ID: BC30645

To correct this error

  1. Define the method without optional parameters.

  2. Use an attribute that can be used with methods that have optional parameters.

  3. Define a custom attribute that can be used in this context.

See Also

Reference

AttributeUsageAttribute

Other Resources

Attributes in Visual Basic