Root namespace <namespacename> is not CLS-compliant

An assembly is marked as <CLSCompliant(True)>, but the root namespace name begins with an underscore (_).

A programming element can contain one or more underscores, but to be compliant with the Common Language Specification (CLS), it must not begin with an underscore. See Declared Element Names.

When you apply the CLSCompliantAttribute to a programming element, you set the attribute's isCompliant parameter to either True or False to indicate compliance or noncompliance. There is no default for this parameter, and you must supply a value.

If you do not apply the CLSCompliantAttribute to an element, it is considered to be noncompliant.

By default, this message is a warning. For information on hiding warnings or treating warnings as errors, see Configuring Warnings in Visual Basic.

Error ID: BC40038

To correct this error

  • If you require CLS compliance, change the root namespace name so that it does not begin with an underscore.

  • If you require that the root namespace name remain unchanged, then remove the CLSCompliantAttribute from the assembly or mark it as <CLSCompliant(False)>.

See Also

Tasks

How to: Change the Namespace for an Application (Visual Basic)

Concepts

Namespaces in Visual Basic

Declared Element Names

Visual Basic Naming Conventions

Writing CLS-Compliant Code

Reference

Namespace Statement

/rootnamespace