Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VerbAttribute violates CS3016 code inspection #927

Open
adamdc78-sf opened this issue Apr 23, 2024 · 0 comments
Open

VerbAttribute violates CS3016 code inspection #927

adamdc78-sf opened this issue Apr 23, 2024 · 0 comments

Comments

@adamdc78-sf
Copy link

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: <TargetFrameworks>net48;netstandard2.1</TargetFrameworks>
  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant