commandlineparser / commandlineparser/commandline

VerbAttribute violates CS3016 code inspection

Open
#927 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
4.8k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
VerbAttribute current accepts a string array for aliases, making it non-compliant with CLS standards.

**To Reproduce**
* Create a solution targeting .NET Framework 4.8
* Create a project which targets .NET Framework 4.8 AND .NET Standard 2.1: `net48;netstandard2.1`
* Create a class which uses a Verb attribute (in either project) such as:

```
[Verb("MyVerb", HelpText = "MyVerb HelpText")]
public class MyClassWithVerb { }
```

**Expected behavior**
No code analysis/compiler warnings.

**Additional context**
The following code analysis compiler warning is received when using `VerbAttribute`:

```
Severity Code Description Project File Line Suppression State
Warning CS3016 Arrays as attribute arguments is not CLS-compliant MyProject C:\Path\To\Source\MyClass.cs 14 Active
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.