Compiler Warning (level 1) CS3012
You cannot specify the CLSCompliant attribute on a module that differs from the CLSCompliant attribute on the assembly
In order for a module to be compliant with the Common Language Specification (CLS) through [module:System.CLSCompliant(true)]
, it must be built with the module element of the TargetType compiler option. For more information on the CLS, see Language independence and language-independent components.
Example
The following example, when built without /target:module
, generates CS3012:
// CS3012.cs
// compile with: /W:1
[module:System.CLSCompliant(true)] // CS3012
public class C
{
public static void Main()
{
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for