Code Analyzer detects that the only argument to a class method is unused. In other words, the value that the method returns is independent of the object that calls it. This can happen due to a typographical error in the method body, or it can be the desired behavior. However, it might be appropriate to make the method a static method, so your code can call it when there is no object available.
Do one of the following:
If the code produces this message due to an error in the method definition, fix the definition.
If the definition is correct and you want to make the method static,
put the method into a method block with the Static
attribute. Then, remove the unused argument.
If you do not want to make the method Static
,
suppress this message as described in Adjust Code Analyzer Message Indicators and Messages.
For more information, see “Defining a Static Method”.