CLS-Compliant?

P

pnp

I tried to add an accessor into a class of an Interface of another class,
but the problem is that the compiler displays an error:

Type of 'A.B.C.IUsers' is not CLS-compliant


What does this mean?

-pnp
 
S

Scott Allen

Hi pnp:

The Common Language Specification (CLS) is a set of core language
features designed to be supported by every .NET language.

If you are writing a class library for a wide range of .NET customers,
CLS compliance is fairly important. If you are writing a library to
use in applications inside your company, CLS compliance can be less
important.

CLS compliant code will work with VB.NET or Python.NET or Cobol.NET,
and so on. If you are not CLS compliant, than you might have trouble
with language interoperability because the code depends on a feature
only guaranteed to have support in the current language.

This error also means the CLSCompliant(true) attribute is somewhere in
the code.

Hope this helps,
 
P

pnp

This helps a lot! thanks Scott.


Scott Allen said:
Hi pnp:

The Common Language Specification (CLS) is a set of core language
features designed to be supported by every .NET language.

If you are writing a class library for a wide range of .NET customers,
CLS compliance is fairly important. If you are writing a library to
use in applications inside your company, CLS compliance can be less
important.

CLS compliant code will work with VB.NET or Python.NET or Cobol.NET,
and so on. If you are not CLS compliant, than you might have trouble
with language interoperability because the code depends on a feature
only guaranteed to have support in the current language.

This error also means the CLSCompliant(true) attribute is somewhere in
the code.

Hope this helps,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top