I need a tool that can load one or more .NET assemblies and check whether the assembly and its contents are CLS compliant or not. If not, the tool should produce a list of items that shows what makes the assembly non-CLS compliant. The rules for CLS compliance should be the forty rules specified in ECMA 335. E.g. if one method argument is of type unsigned int then the method is not CLS compliant, the method name and the parameter should then be printed.
The tool should be a command line tool written in either C# or C++/CLI
## Deliverables
I think the brief summary pretty well captures the requirements but here are some more pointers:
The tool should output error messages whenever an assembly violates any of the CLS rules (if applicable(1)). The error messages should be written to the console and/or log file in English and in such way that it is possible to pinpoint exactly what CLS violation was violated and where it happened.
One or more test assembly of various degrees CLS compliance can be used as input so the expected results are clearly defined. I will also provide with a couple of assemblies to test the tool and if they pass, the tool will be considered finished.
Another example of a CLS violation:
> Two types declared but only differ in case
>
> class ONE
> class one
>
> this is allowed in C# however it's not CLS compliant
>
> I would expect an error message stating the class name and a CLS error message "assembly xxx contains class name ONE/one which violates CLS Rule 4"
>
I think loading an assembly and going through the metadata is the way to go to solve this.
(1) Some CLS rules are a bit tricky to check, for instance CLS rule 40 that objects thrown must be of type [login to view URL], here I am not expecting miracles as this would mean some active calling of methods in the assembly - we don't need to go there - do as good as you can.