Compartir a través de


CodeAnalysisRuleSettings.CreateFromSettingsString Method

Definition

Creates a CodeAnalysisRuleSettings configuration based on a settings string like the one used inside SSDT project files. This string defines what rules should be disabled or have their problems treated as errors instead of warnings. Any rule not included in the settings string will be enabled by default.

public static Microsoft.SqlServer.Dac.CodeAnalysis.CodeAnalysisRuleSettings CreateFromSettingsString (string settingsString, out System.Collections.Generic.IList<Microsoft.SqlServer.Dac.Extensibility.ExtensibilityError> errors);
static member CreateFromSettingsString : string * IList -> Microsoft.SqlServer.Dac.CodeAnalysis.CodeAnalysisRuleSettings
Public Shared Function CreateFromSettingsString (settingsString As String, ByRef errors As IList(Of ExtensibilityError)) As CodeAnalysisRuleSettings

Parameters

settingsString
String

A semicolon delimited string identifying rules to be disabled or have problems treated as errors. The format is "-My.Disabled.Rule;+!My.Enabled.RuleWithError;-!My.Disabled.RuleWithError". Hence disabled rules should have "-" before their ID and enabled rules with errors should have "+!" before their ID. Only rules that are to be disabled or have their problems treated as errors should be included in the settings string.

If this parameter is null or contains no valid rules, a default empty configuration will be returned. This will result in all discovered rules being run.

errors
IList<ExtensibilityError>

List of errors found when processing the list.

Returns

Applies to