Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You cannot specify the CLSCompliant attribute on a module that differs from the CLSCompliant attribute on the assembly
This warning occurs if you have a assembly CLSCompliant attribute that conflicts with a module CLSCompliant attribute. An assembly that is CLS compliant cannot contain modules that are not CLS compliant. To resolve this warning, make sure the assembly and module CLSCompliant attributes are either both true or both false, or remove one of the attributes. For more information on CLS Compliance, see Writing CLS-Compliant Code and Common Language Specification.
Example
The following example generates CS3017:
// CS3017.cs
// compile with: /target:module
using System;
[module: CLSCompliant(true)]
[assembly: CLSCompliant(false)] // CS3017
// Try this line instead:
// [assembly: CLSCompliant(true)]
class C
{
static void Main() {}
}