Setting CLS compliance for an entire .NET assembly is possible. But how is it actually done? E.g. with Visual Studio 2008?
+6
A:
You need to add this line to one of your source files:
[assembly: CLSCompliant(true)]
More info on CLS compliant code here.
Michael
2009-04-21 20:09:13
Where does that line go? Into some particular file? Into all source files that contribute to an assembly?Regards, Peter
Peter Mortensen
2009-04-21 20:14:39
No particular file. The attribute applies to the entire assembly the source code is compiled into.More details at the link I posted.
Michael
2009-04-21 20:18:40
Generally you'd put this in your Properties/AssemblyInfo.cs file.
Craig
2009-04-21 20:19:38
+3
A:
Visual Studio adds a directive for the compiler, and the compiler checks the code for some more strict rules than in the native programming language.
You can add CLS compilant to all your project by adding the assembly level attribute
[assembly: CLSCompliantAttribute(true)]
anywhere in your project, generally in the assemblyinfo.cs file.
pocheptsov
2009-04-21 20:17:38