Disable CLS compliance check in C #

I am working on code that has the following attributes for some of its methods:

[CLSCompliantAttribute(false)] 

How is it that when I create the code as is, I see that the conformity check is being performed, and when I comment on it, it seems that the conformance check is NOT being performed?

I expected the opposite behavior ...

+5
source share
2 answers

Adding [CLSCompliant(false)]means you added it as incompatible.

If you mark a member as inappropriate, the compiler will not warn you if it does not meet the requirements. (Since you said that this does not meet the requirements.)

, , ( ), (, uint), ( ).

+8

AssemblyInfo.cs, , : *. :

using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: CLSCompliant(false)]


// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is     exposed to COM
[assembly: Guid("d29c53b6-88e4-4b33-bb86-f39b4c733542")]

// Version information for an assembly consists of the following four     values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build     Numbers 
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+1

All Articles