- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.2k
Closed
Labels
Area-CompilersNeed More InfoThe issue needs more information to proceed.The issue needs more information to proceed.
Milestone
Description
Compile the following code:
using System;
[assembly:CLSCompliant(true)]
[CLSCompliant(false)]
public sealed class SharingBoundaryAttribute : Attribute
{
    public SharingBoundaryAttribute(params string[] sharingBoundaryNames)
    {
    }
}
class LightweightWebBenchmark
{
    [SharingBoundary("name")]
    public object WebScopeFactory { get; set; }
}EXPECTED: No warnings
ACTUAL: warning CS3016: Arrays as attribute arguments is not CLS-compliant
If you try to disable the warning by putting [CLSCompliant(false)] on the LightweightWebBenchmark class (or its WebScopeFactory property), you get this error:
warning CS3019: CLS compliance checking will not be performed on 'LightweightWebBenchmark' because it is not visible from outside this assembly
So for code like this it doesn't appear possible to avoid CLS compliance warnings, without disabling CLS compliance for the whole assembly or using specifically ignoring this warning.
Metadata
Metadata
Assignees
Labels
Area-CompilersNeed More InfoThe issue needs more information to proceed.The issue needs more information to proceed.