This topic has not yet been rated - Rate this topic

Compiler Warning (level 1) CS3022

CLSCompliant attribute has no meaning when applied to parameters. Try putting it on the method instead.

Method parameters are not checked for CLS Compliance, since the CLS Compliance rules apply to methods and type declarations.

The following sample generates CS3022:

// CS3022.cs
// compile with: /W:1

using System;

[assembly: CLSCompliant(true)]
[CLSCompliant(true)]
public class C
{
    public void F([CLSCompliant(true)] int i)
    {
    }

    public static void Main()
    {
    }
}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ