If you want to disable warnings at the project level:
Go to the project properties, the code analysis window and click "Open" next to the set of rules to run. Uncheck the warnings that you want to ignore, save the ruleset (you may need to do “Save as” because you cannot change the default ruleset), go back to the “Project code analysis” tab and select the ruleset which you just saved.
If you just want to disable certain warnings in certain places in the code:
Use SuppressMessageAttribute .
Daniel Plaisted
source share