C#: How to suppress an error than keeps the solution from building

/ Published in: C#
Save to your folder(s)

Paste the code below, above the the method that's causing the error.

Replace Microsoft.Performance with the type of error it is.
Replace CA1822 with the error number.
Look up what the error number is and replace MarkMemberAsStatic with its definition.
Replace the Justification string with the reason you're suppressing the error.

If your using FxCop:
Analyze your code using the FxCop utility.
In the Active window / tab, right click on the line that represents the error.
Select Copy As / SuppressMessage.
Paste above the method that's causing the error. This process will give you the same code as the steps above. It just easier.

Copy this code and paste it in your HTML
  1. [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Not Implemented Yet")]

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.