'System.Runtime.InteropServices.DllImportAttribute' cannot be applied to a Sub, Function, or Operator with a non-empty body

The DllImportAttribute attribute was applied to a Sub, Function, or Operator that is not empty.

Error ID: BC31522

To correct this error

  • Remove all code from the Sub, Function, or Operator to use this attribute.

See Also

Reference

DllImportAttribute

Declare Statement