当我编译Silverlight应用程序时,所有使用MEF属性修饰的元素都是CLS-noncompliance的警告。 当我再次编译时,警告不会返回,我的应用程序似乎运行正常。 这是我需要担心的吗? 我正在使用属性,类等的标准命名约定。 我使用下划线的唯一时间是私人会员。
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.
最满意答案
我假设MEF属性所包含的程序集没有设置CLSCompliant属性。
IE,如果您引用Silverlight类库,则类库应在其AssemblyInfo文件中设置此属性:
[assembly: CLSCompliant(true)]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)]更多推荐
发布评论