为什么我的MEF使用不符合CLS?(Why is my MEF usage not CLS

编程入门 行业动态 更新时间:2024-10-26 17:30:27
为什么我的MEF使用不符合CLS?(Why is my MEF usage not CLS-compliant?)

当我编译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)]

更多推荐

本文发布于:2023-07-20 12:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1199667.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不符合   MEF   usage   CLS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!