This documentation is archived and is not being maintained.

JS1163: The specified member is not CLS compliant

The program contains the CLSCompliantAttribute attribute, and the compiler has detected a class member that is not Common Language Specification (CLS) compliant. Some possible causes of this error are:

  • The member name is not CLS compliant. CLS compliant names cannot start with an underscore (_), contain a dollar sign ($), or differ only in capitalization from the name of another public member.
  • If the member is a public method, data types that are not available in the common language runtime are used to type annotate the parameters or return type.
  • If the member is a field or property, data types that are not available in the common language runtime are used to type annotate field or property.

There are several reasons a data type may not to be available in the common language runtime.

  • The type is defined within the class but it is not publicly accessible.
  • The type is defined but not marked as CLS compliant.
  • The type is a primitive type that is not CLS compliant. For example, uint is a primitive type that is not CLS compliant. The corresponding CLS compliant system type is System.UInt32.
  • The type is an intrinsic JScript object, none of which are CLS compliant. The commonly used JScript objects, Array, Date, Error, RegExp, and Function, correspond to the CLS compliant system types, System.Array, System.DateTime, System.Exception, System.Text.RegularExpressions.RegEx, and System.EventHandler.

To correct this error

  • Make sure that the member name does not start with an underscore (_), contain a dollar sign ($), or differ only in capitalization from the name of another member.
  • Make sure that the parameters or return types for public methods and the types of public fields and properties are common language runtime data types or publicly accessible classes that have been marked as CLS compliant.

See Also

Troubleshooting Your Scripts | JScript Reference | CLSCompliantAttribute Class | Writing CLS-Compliant Code | What is the Common Language Specification?

Show: