基本类型是不符合CLS,这是什么警告的原因是什么? [英] Base type is not CLS-compliant, what reasons of this warning?

查看:2265
本文介绍了基本类型是不符合CLS,这是什么警告的原因是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已得到警告主题在我的课之一。其实类是非常简单的,只是我的通用基类型的继承者。我也有来自全国各地的解决方案,通用类其它继承人,有没有这样的警告。

I have got warning from subject on one of my classes. Actually class is very simple, just an inheritor of my generic base type. Also I have some other inheritors from that generic class across the solution, and there are no such warnings.

什么可能是这个原因(S)?
编译器不给出任何线索,为什么基本类型不符合CLS-

What could be the reason(s) of this? Compiler does not give any clues of why base type is not CLS-compliant

推荐答案

您可能有 [大会:CLSCompliant(真)] 地方在具体项目。这会触发编译器检查所​​有类型是符合CLS。你可以用 [CLSCompliant(假)]

You probably have [assembly:CLSCompliant(true)] somewhere in that specific project. This triggers the compiler to check all types to be CLS compliant. You can override this for a type or method or something with [CLSCompliant(false)].

这篇关于基本类型是不符合CLS,这是什么警告的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆