Share via


ProjectProblemSuppressor Class

Definition

Represents the problem suppressor used by SSDT projects. The ShouldSuppressProblem method can be passed to ShouldSuppressProblem in order to use this class.

This reads suppression information from a file with a name matching SuppressionFilename ("StaticCodeAnalysis.SuppressMessages.xml") in the root directory.

All relative paths will be resolved relative to the project folder defined in the constructor

public sealed class ProjectProblemSuppressor
type ProjectProblemSuppressor = class
Public NotInheritable Class ProjectProblemSuppressor
Inheritance
ProjectProblemSuppressor

Fields

SuppressionFilename

The default file name for a message suppression file within a project.

Properties

ShouldSuppressProblem

Gets the predicate that can be used to

If any errors occur during

Methods

AddSuppressedProblems(IEnumerable<SuppressedProblemInfo>)

Adds one or more instances of SuppressedProblemInfo to the set of suppressed problems. The full set of suppressed problems will be immediately written out to the backing XML file.

CreateSuppressor(String, String)

Creates a new ProjectProblemSuppressor.

CreateSuppressor(String)

Creates a new ProjectProblemSuppressor.

GetSuppressedProblems()

Gets information on what problems will be suppressed. Specifically, a set of SuppressedProblemInfo objects will be returned that defines each combination of a rule being suppressed and the file name for which the rule is suppressed.

ResetSuppressedProblems()

Resets the suppressed problems to their default state. If an XML suppression file for the project existed already then the state will be reloaded from there, otherwise it will be reset so that no problems are suppressed.

UnsuppressRulesFromFile(String)

Removes all problem suppression directives for a particular filename.

The updated set of problems to suppress will be immediately written out to the backing XML file that describes what rules should be suppressed for a given file.

Applies to