CLSCompliant

T

Tony Johansson

Hi!

When a add this attribute
[CLSCompliant(true)]
just above the definition of class Team I get this kind of wanrning
Warning 1 'Lab1.Team' cannot be marked as CLS-compliant because the assembly
does not have a CLSCompliant attribute F:\C#\Lab1\Program.cs 73 5 Lab1

Why do I get this warning ?

//Tony
 
A

Arne Vajhøj

When a add this attribute
[CLSCompliant(true)]
just above the definition of class Team I get this kind of wanrning
Warning 1 'Lab1.Team' cannot be marked as CLS-compliant because the assembly
does not have a CLSCompliant attribute F:\C#\Lab1\Program.cs 73 5 Lab1

Why do I get this warning ?

The error text actually give the cause.

But if you need some more explanation, then there
are sources on the net. A quick googling found:
http://www.devarticles.com/c/a/C-Sharp/Making-Your-Code-CLS-Compliant/

Arne
 
T

Tony Johansson

Arne Vajhøj said:
When a add this attribute
[CLSCompliant(true)]
just above the definition of class Team I get this kind of wanrning
Warning 1 'Lab1.Team' cannot be marked as CLS-compliant because the
assembly
does not have a CLSCompliant attribute F:\C#\Lab1\Program.cs 73 5 Lab1

Why do I get this warning ?

The error text actually give the cause.

But if you need some more explanation, then there
are sources on the net. A quick googling found:
http://www.devarticles.com/c/a/C-Sharp/Making-Your-Code-CLS-Compliant/

Arne

Is it common to have to add attribute to the assembly as it is with
the attribute CLSCompliant.
Without adding this to the assembly I got this compile warning
Warning 1 'Lab1.Team' cannot be marked as CLS-compliant because the assembly
does not have a CLSCompliant attribute F:\C#\Lab1\Program.cs 73 5 Lab1

//Tony
 
A

Arne Vajhøj

Arne Vajhøj said:
When a add this attribute
[CLSCompliant(true)]
just above the definition of class Team I get this kind of wanrning
Warning 1 'Lab1.Team' cannot be marked as CLS-compliant because the
assembly
does not have a CLSCompliant attribute F:\C#\Lab1\Program.cs 73 5 Lab1

Why do I get this warning ?

The error text actually give the cause.

But if you need some more explanation, then there
are sources on the net. A quick googling found:
http://www.devarticles.com/c/a/C-Sharp/Making-Your-Code-CLS-Compliant/

Is it common to have to add attribute to the assembly as it is with
the attribute CLSCompliant.
Without adding this to the assembly I got this compile warning
Warning 1 'Lab1.Team' cannot be marked as CLS-compliant because the assembly
does not have a CLSCompliant attribute F:\C#\Lab1\Program.cs 73 5 Lab1

I don't consider it common.

But it may depend on what you are working on.

Arne
 

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