Setting CLS compliance for an entire .NET assembly is possible. But how is it actually done? E.g. with Visual Studio 2008?
Asked
Active
Viewed 1.9k times
2 Answers
42
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 the CLS compliant attribute to all your project by adding the assembly level attribute
[assembly: CLSCompliant(true)]
anywhere in your project, generally in the assemblyinfo.cs
file.
If the line using System;
is not at the top of the file, add it. Or, use the long form:
[assembly: System.CLSCompliant(true)]

DavidRR
- 18,291
- 25
- 109
- 191

pocheptsov
- 1,936
- 20
- 24