Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with the complete warning code and message, then fix the specific public API or build-metadata issue it identifies. “CS3000-series” is not one error with one universal repair: some warnings concern exposed types, while others concern inheritance, naming, interfaces, or assembly and module attributes. The Microsoft references below cover representative CLS warnings; match your compiler’s exact diagnostic before changing code.

What CLS compliance warnings mean

The Common Language Specification (CLS) defines rules that help components work across .NET languages. A library may compile and run in C# while exposing a type or name that another CLS-compliant language cannot use consistently. That is why these warnings matter most at the public API boundary.

Microsoft states: “The rules for CLS compliance apply only to a component’s public interface, not to its private implementation.” Public, protected, and protected internal declarations may be part of that interface; private implementation details generally are not. See Microsoft’s Language independence and language-independent components.

Before editing, record the full warning code and text, the named type or member, and the build context. Also note the compiler or SDK version, target framework, and whether the build produces an assembly or a module. A warning such as “Argument type ‘type’ is not CLS-compliant” points to a different repair from “Type of ‘variable’ is not CLS-compliant.”

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a fix by warning code

Warning What to inspect Remediation direction
CS3001 Parameter types on public, protected, or protected internal methods. Use a CLS-compliant type in the public signature if the contract permits, and convert or validate internally. See Microsoft’s CS3001 reference.
CS3003 The type of an exposed variable or member, such as a public field or property. Change the exposed type if possible; a private backing field may retain a noncompliant implementation type. See Microsoft’s CS3003 reference.
CS3009 / CS3027 The base class or base interface named by the diagnostic. Make compliance claims consistent across the inheritance relationship, or redesign the API. See CS3009 and CS3027.
CS3010 A member of an interface declared CLS-compliant. A CLS-compliant interface cannot contain a member explicitly marked noncompliant. Redesign the interface or align the compliance declarations. See Microsoft’s CS3010 reference.
CS3012 / CS3013 Module-level compliance metadata and whether the output target is an assembly or module. Align module declarations with the assembly and compilation state. See Microsoft’s CS3012, CS3013, and module warning guidance.
CS3014 / CS3021 Member-level CLS attributes and the assembly-level declaration. If the assembly intentionally claims CLS compliance, add [assembly: CLSCompliant(true)]; otherwise remove unnecessary member attributes. See CS3014 and CS3021.
CS3017 CLS attribute values declared for the assembly and module. Make the values agree, or remove the conflicting declaration. See Microsoft’s CS3017 reference.
Other codes The exact diagnostic message and its corresponding compiler reference. Diagnose the named issue rather than assuming that every CS3000-family warning calls for replacing an unsigned type.

Fix exposed noncompliant types without breaking the contract blindly

CS3001: noncompliant method parameter

Check the parameter types on the method named in the warning. For example, a public method that accepts UInt32 may be unusable from a language that does not support that type under CLS rules. If possible, expose a compliant alternative such as Int32, then validate and convert at the implementation boundary.

Do not cast blindly. An unsigned value may exceed the replacement type’s range, and a signed value may be negative even if the internal representation must be nonnegative. Define the accepted range and failure behavior as part of the API contract. Microsoft’s CS3001 example shows the parameter-signature issue.

CS3003: noncompliant exposed field or property

Treat public fields and properties as API surface. Microsoft’s CLS overview illustrates a public UInt16 age property and a private UInt16 backing field: changing the exposed property to Int16 addresses the public-surface issue while the private storage can remain unsigned. For a public UInt32 property, Int32 may work only if the value range and validation rules fit the contract. See the CLS overview and CS3003 reference.

Decide whether to change or opt out

Choose based on the audience and compatibility cost, not just the warning count.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Change the public signature: Improves cross-language usability, but may break source or binary compatibility for existing consumers. Check that the replacement represents the values your API promises and define overflow and validation behavior.
  • Keep the feature and mark it noncompliant: Use [CLSCompliant(false)] on the applicable public type or member when the noncompliant surface is intentional, within an assembly whose compliance policy is explicitly declared. This warns consumers that the feature is not portable to all CLS languages.
  • Offer both paths: If cross-language use matters, provide a compliant alternative and document the relationship between it and the noncompliant member.

For UInt64, changing to Int64 may lose valid values. A different type such as BigInteger, or a redesigned contract, may be more appropriate; select only after defining the supported range and consumer requirements.

Fix inheritance and interface consistency warnings

CS3009 and CS3027: base types and interfaces

Follow the diagnostic to the named base class or interface. A type declared CLS-compliant cannot derive from a noncompliant base type; the same consistency issue can arise with a base interface. Decide whether the base API should be redesigned or whether the affected public type should be explicitly noncompliant. See Microsoft’s references for CS3009 and CS3027.

CS3010: noncompliant interface member

A CLS-compliant interface cannot include a member marked [CLSCompliant(false)]. If consumers across languages need the interface, redesign it around compliant members. If the interface is intentionally language-specific, make the compliance claims on the interface and its members consistent rather than claiming that the interface is CLS-compliant. See CS3010.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Fix assembly and module attribute warnings

These warnings concern declarations and build output, not the choice between signed and unsigned data types. First establish whether you intend the assembly to claim CLS compliance and whether the compiler is producing an assembly or a module. Then compare the assembly- and module-level attributes with the target’s configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Member attribute but no assembly declaration (CS3014 or CS3021): If the assembly deliberately makes a CLS claim, put [assembly: CLSCompliant(true)] in an assembly-level source file. If it does not, remove member-level attributes that serve no purpose. Confirm which diagnostic you have: CS3014 and CS3021 describe related but distinct cases.
  2. Module compliance declaration (CS3012 or CS3013): Check whether the build actually targets a module and whether its declaration matches the assembly’s compliance state. Module-level declarations have meaning in that output context; do not add them as a substitute for an assembly policy. Consult Microsoft’s CS3012 and CS3013 guidance.
  3. Conflicting assembly and module values (CS3017): Make both declarations agree, or remove the declaration that does not reflect the intended policy. See CS3017.

Check naming and other CLS rules before changing types

Not every CLS issue is a type-representation problem. The CLS overview also discusses unmanaged and function pointer types, enum underlying types outside the compliant intrinsic set, identifiers that differ only by case, and public identifiers beginning with an underscore. If the diagnostic names an identifier or declaration pattern, fix that rule directly. Microsoft documents the public-identifier restriction in its CS3008 reference.

Do not treat every code in a broad CS3000-numbered range as a CLS warning. Use the exact code and message shown by your compiler; other diagnostics in that range may concern unrelated compiler issues. Microsoft’s warning pages are official C# and .NET guidance, but compiler behavior can depend on the target environment. If the relevant reference does not resolve your case, verify against the compiler or SDK version and target framework used by your build.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.