Arguments which are passed to formatting methods (such as String.Format()) but are not used, are either unnecessary or mean that the format string is incorrect. The result is that the argument will be ignored, which may not be the intended behavior.

Change the format string to use the highlighted argument, or remove the unnecessary argument.

Here are three examples where the format string does not use all the arguments.

  • On line 5, the second argument (ex.HResult) is not logged.
  • On line 6, the first argument (ex) is not logged but the second argument (ex.HResult) is logged twice.
  • On line 4, a C-style format string is used, which is incorrect, and neither argument will be logged.
  • MSDN: String.Format Method.
  • Microsoft: Composite Formatting.