对于在.NET框架(.NET Framework)下进行开发的程序员来说,无法回避的一个问题就是:什么是.NET框架?
需要注意的是,'CLSCompliant' 特性默认值为 'true',即默认情况下,类型和成员是符合 CLS 规范的。因此,在大多数情况下,只需要在不符合 CLS 规范的类型或成员上显式地将 'CLSCompliant' 特性设置为 'false' 即可。 总之,'CLSCompliant' 属性是一个重要的工具,可以帮助开发人员确保他们编写的代码遵循 CLS 规范,从而...
[CLSCompliant(false)] uintSystem.IConvertible.ToUInt32(IFormatProvider provider); 这是因为有的语言不支持UInt32类型。 再看看对UInt32反编译的结果,UInt32的声明: [Serializable, StructLayout(LayoutKind.Sequential),CLSCompliant(false)] public struct UInt32 : IComparable, IFormattable, IConvertible { } 什...
[CLSCompliant(false)] uintSystem.IConvertible.ToUInt32(IFormatProvider provider); 这是因为有的语言不支持UInt32类型。 再看看对UInt32反编译的结果,UInt32的声明: [Serializable, StructLayout(LayoutKind.Sequential),CLSCompliant(false)] public struct UInt32 : IComparable, IFormattable, IConvertible { } 什...
获取指示所指示的程序元素是否符合 CLS 的布尔值。 C# 复制 public bool IsCompliant { get; } 属性值 Boolean 如果程序元素符合 CLS,则为 true;否则为 false。 适用于 产品版本 .NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 .NET Framework 1.1, ...
If an assembly is marked as CLS-compliant, any publicly exposed type in the assembly that is not CLS-compliant must be marked with CLSCompliantAttribute using a false argument. Similarly, if a class is marked as CLS-compliant, you must individually mark all members that are not CLS-compliant...
[CLSCompliant(false)] public int SetValue(UInt32 value); 注解特性CLSCompliantAttribute 用于指示特定程序元素是否符合公共语言规范 (CLS) ,该规范定义了面向 .NET 的任何语言必须支持的功能。 库开发人员希望确保以任何面向 .NET 的语言访问其库时,主要关注 CLS 合规性。 有关详细信息,请参阅 语言独立性和Lang...
If an assembly is marked as CLS-compliant, any publicly exposed type in the assembly that is not CLS-compliant must be marked with CLSCompliantAttribute using a false argument. Similarly, if a class is marked as CLS-compliant, you must individually mark all members that are not CLS-compliant...
trueif the program element is CLS-compliant; otherwise,false. Applies to TuoteVersiot .NETCore 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 .NET Framework1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, ...
If an assembly is marked as CLS-compliant, any publicly exposed type in the assembly that is not CLS-compliant must be marked with CLSCompliantAttribute using a false argument. Similarly, if a class is marked as CLS-compliant, you must individually mark all members that are not CLS-compliant...