Why is my MEF usage not CLS-compliant?
-
05-12-2019 - |
Question
When I compile my Silverlight application, all of the elements that are decorated with MEF attributes are warning of CLS-noncompliance. When I compile again, the warnings do not return, and my application seems to run fine. Is this something that I need to worry about? I'm using a standard naming convention for properties, classes, and such. The only time I use underscores is with private members.
Solution
I'd assume the assembly the MEF attributes were contained in do not have the CLSCompliant attribute set.
IE, if you reference a Silverlight class library, the class library should have this attribute set in its AssemblyInfo file:
[assembly: CLSCompliant(true)]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow