From: Tony Johansson on 17 Feb 2010 05:55 Hi! Here I have a simple program that is not CLSCompliant because of two things 1. Two methods with same name but differ in case. 2. The program return an uint which should not be CLSCompliant As you can see I have declared the CLSCompliantAttribute as an assembly attribut but the compilers is happy and give not a single warning about this. Can somebody explain this ? using System; using System.Collections.Generic; using System.Text; [assembly: CLSCompliantAttribute(true)] namespace ConsoleApplication8 { class Program { uint tal = 2; public uint Foo() { return tal; } public uint FOO() { return tal; } static void Main(string[] args) { Program prog = new Program(); } } } //Tony
From: Patrice on 17 Feb 2010 06:56 Hello, Just add the "public" modifier. Else the class is private and the CLS compliance is not checked... -- Patrice
From: Heandel on 17 Feb 2010 07:46 From what I've seen in previous experiences, the compiler simply "trusts" you and doesn't perform any kind of check. Heandel
From: Peter Duniho on 17 Feb 2010 13:07 Patrice wrote: > Hello, > > Just add the "public" modifier. Else the class is private and the CLS > compliance is not checked... Minor nit: the class is "internal" by default, not "private".
From: Arne Vajhøj on 17 Feb 2010 19:26
On 17-02-2010 13:07, Peter Duniho wrote: > Patrice wrote: >> Just add the "public" modifier. Else the class is private and the CLS >> compliance is not checked... > > Minor nit: the class is "internal" by default, not "private". private is not even valid in the context. Arne |