SourceGeneratorContext.ReportDiagnostic(Diagnostic) Method

Definition

Adds a Diagnostic to the users compilation

public void ReportDiagnostic (Microsoft.CodeAnalysis.Diagnostic diagnostic);
member this.ReportDiagnostic : Microsoft.CodeAnalysis.Diagnostic -> unit
Public Sub ReportDiagnostic (diagnostic As Diagnostic)

Parameters

diagnostic
Diagnostic

The diagnostic that should be added to the compilation

Remarks

The severity of the diagnostic may cause the compilation to fail, depending on the Compilation settings.

Applies to