6 overrides of GetMessage
Microsoft.CodeAnalysis (5)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
51public override string GetMessage(IFormatProvider? formatProvider = null)
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
43public override string GetMessage(IFormatProvider? formatProvider = null)
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
90public override string GetMessage(IFormatProvider? formatProvider = null)
Diagnostic\DiagnosticWithInfo.cs (1)
99public override string GetMessage(IFormatProvider? formatProvider = null)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
102public override string GetMessage(IFormatProvider? formatProvider = null)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
EvaluationContextBase.cs (1)
161public override string GetMessage(IFormatProvider? formatProvider = null)
115 references to GetMessage
Microsoft.Analyzers.Local.Tests (2)
CallAnalysis\UseThrowsTests.cs (2)
35Assert.Contains(ThrowHelpersClass + exception, d[0].GetMessage(), StringComparison.Ordinal); 283Assert.Contains(ThrowIfNullHelper, d[0].GetMessage(), StringComparison.Ordinal);
Microsoft.AspNetCore.App.Analyzers.Test (56)
Components\DisallowNonLiteralSequenceNumbersTest.cs (3)
48Assert.StartsWith("'i' should not be used as a sequence number.", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 69Assert.StartsWith("'i' should not be used as a sequence number.", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 90Assert.StartsWith("'ComputeSequenceNumber(0)' should not be used as a sequence number.", diagnostic.GetMessage(CultureInfo.InvariantCulture));
RouteEmbeddedLanguage\RoutePatternAnalyzerTests.cs (11)
47Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture)); 79Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture)); 112Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture)); 140Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture)); 168Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture)); 197Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), diagnostic.GetMessage(CultureInfo.InvariantCulture)); 228Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.FormatTemplateRoute_InvalidLiteral("~hi?")), d.GetMessage(CultureInfo.InvariantCulture)); 233Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.TemplateRoute_InvalidRouteTemplate), d.GetMessage(CultureInfo.InvariantCulture)); 295Assert.Equal(Resources.FormatAnalyzer_RouteIssue_Message(Resources.AttributeRoute_TokenReplacement_UnclosedToken), d.GetMessage(CultureInfo.InvariantCulture)); 335Assert.Equal(Resources.FormatAnalyzer_UnusedParameter_Message("id"), d.GetMessage(CultureInfo.InvariantCulture)); 489Assert.Equal(Resources.FormatAnalyzer_UnusedParameter_Message("id"), d.GetMessage(CultureInfo.InvariantCulture));
RouteHandlers\DetectMisplacedLambdaAttributeTest.cs (6)
50Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 72Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 98Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 104Assert.Equal("'ProducesAttribute' should be placed directly on the route handler lambda to be effective", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 131Assert.Equal("'ProducesAttribute' should be placed directly on the route handler lambda to be effective", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 220Assert.Equal("'AuthorizeAttribute' should be placed directly on the route handler lambda to be effective", diagnostic.GetMessage(CultureInfo.InvariantCulture));
RouteHandlers\DisallowMvcBindArgumentsOnParametersTest.cs (2)
63Assert.Equal("BindAttribute should not be specified for a MapGet Delegate parameter", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 85Assert.Equal("ModelBinderAttribute should not be specified for a MapPost Delegate parameter", diagnostic.GetMessage(CultureInfo.InvariantCulture));
RouteHandlers\DisallowReturningActionResultsFromMapMethodsTest.cs (6)
132Assert.Equal("IActionResult instances should not be returned from a MapGet Delegate parameter. Consider returning an equivalent result from Microsoft.AspNetCore.Http.Results.", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 155Assert.Equal("IActionResult instances should not be returned from a MapGet Delegate parameter. Consider returning an equivalent result from Microsoft.AspNetCore.Http.Results.", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 183Assert.Equal("IActionResult instances should not be returned from a MapPost Delegate parameter. Consider returning an equivalent result from Microsoft.AspNetCore.Http.Results.", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 215Assert.Equal("IActionResult instances should not be returned from a MapPost Delegate parameter. Consider returning an equivalent result from Microsoft.AspNetCore.Http.Results.", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 253Assert.Equal("IActionResult instances should not be returned from a MapPost Delegate parameter. Consider returning an equivalent result from Microsoft.AspNetCore.Http.Results.", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 291Assert.Equal("IActionResult instances should not be returned from a MapPost Delegate parameter. Consider returning an equivalent result from Microsoft.AspNetCore.Http.Results.", diagnostic.GetMessage(CultureInfo.InvariantCulture));
WebApplicationBuilder\DisallowConfigureHostBuilderConfigureWebHostTest.cs (7)
47Assert.Equal("ConfigureWebHost cannot be used with WebApplicationBuilder.Host", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 68Assert.Equal("ConfigureWebHost cannot be used with WebApplicationBuilder.Host", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 90Assert.Equal("ConfigureWebHost cannot be used with WebApplicationBuilder.Host", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 130Assert.Equal("ConfigureWebHost cannot be used with WebApplicationBuilder.Host", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 158Assert.Equal("ConfigureWebHost cannot be used with WebApplicationBuilder.Host", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 187Assert.Equal("ConfigureWebHost cannot be used with WebApplicationBuilder.Host", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 221Assert.Equal("ConfigureWebHost cannot be used with WebApplicationBuilder.Host", diagnostic.GetMessage(CultureInfo.InvariantCulture));
WebApplicationBuilder\DisallowConfigureHostLoggingTest.cs (1)
275Assert.Equal("Suggest using builder.Logging instead of ConfigureLogging", diagnostic.GetMessage(CultureInfo.InvariantCulture));
WebApplicationBuilder\DisallowConfigureServicesTest.cs (1)
286Assert.Equal("Suggest using builder.Services instead of ConfigureServices", diagnostic.GetMessage(CultureInfo.InvariantCulture));
WebApplicationBuilder\DisallowConfigureWebHostBuilderConfigureTest.cs (4)
49Assert.Equal("Configure cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 70Assert.Equal("Configure cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 97Assert.Equal("Configure cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 125Assert.Equal("Configure cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture));
WebApplicationBuilder\DisallowConfigureWebHostBuilderUseStartupTest.cs (6)
48Assert.Equal("UseStartup cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 69Assert.Equal("UseStartup cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 89Assert.Equal("UseStartup cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 110Assert.Equal("UseStartup cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 137Assert.Equal("UseStartup cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 165Assert.Equal("UseStartup cannot be used with WebApplicationBuilder.WebHost", diagnostic.GetMessage(CultureInfo.InvariantCulture));
WebApplicationBuilder\UseTopLevelRouteRegistrationInsteadOfUseEndpointsTest.cs (9)
124Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 165Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic1.GetMessage(CultureInfo.InvariantCulture)); 169Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic2.GetMessage(CultureInfo.InvariantCulture)); 173Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic3.GetMessage(CultureInfo.InvariantCulture)); 177Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic2.GetMessage(CultureInfo.InvariantCulture)); 209Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 235Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic.GetMessage(CultureInfo.InvariantCulture)); 265Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic1.GetMessage(CultureInfo.InvariantCulture)); 269Assert.Equal("Suggest using top level route registrations instead of UseEndpoints", diagnostic2.GetMessage(CultureInfo.InvariantCulture));
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Verifiers\DiagnosticVerifier.cs (2)
172if (actual.GetMessage(CultureInfo.InvariantCulture) != expected.Message) 178expected.Message, actual.GetMessage(CultureInfo.InvariantCulture), FormatDiagnostics(analyzer, actual)));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Verifiers\DiagnosticVerifier.cs (2)
172if (actual.GetMessage(CultureInfo.InvariantCulture) != expected.Message) 178expected.Message, actual.GetMessage(CultureInfo.InvariantCulture), FormatDiagnostics(analyzer, actual)));
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\CompileTimeCreationTests.AsParameters.cs (1)
85Assert.Equal(message, diagnostic.GetMessage(CultureInfo.InvariantCulture));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CompilationFailedExceptionFactory.cs (1)
121diagnostic.GetMessage(CultureInfo.CurrentCulture),
Microsoft.CodeAnalysis (9)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
58_originalDiagnostic.GetMessage(formatProvider),
CommandLine\SarifV1ErrorLogger.cs (1)
72string? message = diagnostic.GetMessage(_culture);
CommandLine\SarifV2ErrorLogger.cs (1)
65string? message = diagnostic.GetMessage(_culture);
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
44=> _originalUnsuppressedDiagnostic.GetMessage(formatProvider);
Diagnostic\DiagnosticFormatter.cs (2)
60diagnostic.GetMessage(culture), 66diagnostic.GetMessage(culture),
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
1355exceptionDiagnostic.GetMessage() == other.GetMessage();
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
104return _original.GetMessage(formatProvider);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
47var title = diagnostic.GetMessage();
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
32var title = diagnostic.GetMessage();
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
47var title = diagnostic.GetMessage();
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
32var title = diagnostic.GetMessage();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\UseSiteErrorTests.cs (1)
1239Assert.DoesNotContain("System.Runtime.CompilerServices.CompilerGeneratedAttribute", diag.GetMessage(), StringComparison.Ordinal);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
DebuggerDiagnosticFormatter.cs (1)
24diagnostic.GetMessage(culture));
Microsoft.CodeAnalysis.Features (1)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (1)
74message: diagnostic.GetMessage(),
Microsoft.CodeAnalysis.Features.UnitTests (11)
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
289Assert.Equal(diagnostic.GetMessage(), (await proxy.GetDocumentDiagnosticsAsync(document, activeStatementSpanProvider, CancellationToken.None)).Single().Message);
EditAndContinue\RudeEditDiagnosticTests.cs (10)
87Assert.False(d.GetMessage().Contains("{"), kind.ToString()); 93Assert.True(d.GetMessage().Contains("<1>"), kind.ToString()); 94Assert.True(d.GetMessage().Contains("<2>"), kind.ToString()); 95Assert.False(d.GetMessage().Contains("{"), kind.ToString()); 101Assert.True(d.GetMessage().Contains("<1>"), kind.ToString()); 102Assert.True(d.GetMessage().Contains("<2>"), kind.ToString()); 103Assert.True(d.GetMessage().Contains("<3>"), kind.ToString()); 104Assert.False(d.GetMessage().Contains("{"), kind.ToString()); 110Assert.True(d.GetMessage().Contains("<1>"), kind.ToString()); 111Assert.False(d.GetMessage().Contains("{"), kind.ToString());
Microsoft.CodeAnalysis.InteractiveHost (1)
Interactive\Core\InteractiveHost.Service.cs (1)
533writer.WriteLine(error.GetMessage(CultureInfo.CurrentUICulture));
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\DiagnosticExtensions.cs (2)
128var diagnosticMessage = diagnostic.GetMessage(); 446=> e.Location.IsInSource ? $"{e.Severity} {e.Id}: {e.GetMessage(CultureInfo.CurrentCulture)}" :
Microsoft.CodeAnalysis.UnitTests (3)
Diagnostics\DiagnosticLocalizationTests.cs (3)
93Assert.Equal(fixedMessageFormat, localizableDiagnostic.GetMessage()); 98Assert.Equal(fixedMessageFormat, localizableDiagnostic.GetMessage(CustomResourceManager.DefaultCulture)); 103Assert.Equal(localizedMessageFormat, localizableDiagnostic.GetMessage(arCulture));
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
CommandLineTests.vb (2)
9759New VBDiagnostic(ErrorFactory.ErrorInfo(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "C"), Location.None).GetMessage(CultureInfo.InvariantCulture), 9816New VBDiagnostic(ErrorFactory.ErrorInfo(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "C"), Location.None).GetMessage(CultureInfo.InvariantCulture),
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (8)
CompilationTestUtils.vb (7)
1005Dim message = e.Id + ": " + e.GetMessage(EnsureEnglishUICulture.PreferredOrNull) 1044Return comparer.Compare(diag1.GetMessage(EnsureEnglishUICulture.PreferredOrNull), diag2.GetMessage(EnsureEnglishUICulture.PreferredOrNull)) 1063Return comparer.Compare(diag1.GetMessage(EnsureEnglishUICulture.PreferredOrNull), diag2.GetMessage(EnsureEnglishUICulture.PreferredOrNull)) 1072Return comparer.Compare(diag1.GetMessage(EnsureEnglishUICulture.PreferredOrNull), diag2.GetMessage(EnsureEnglishUICulture.PreferredOrNull))
ParserTestUtilities.vb (1)
610If message IsNot Nothing AndAlso message <> syntaxError.GetMessage(EnsureEnglishUICulture.PreferredOrNull) Then
Microsoft.CodeAnalysis.Workspaces (2)
Diagnostics\DiagnosticData.cs (1)
231diagnostic.GetMessage(CultureInfo.CurrentUICulture),
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
274logger.Log(" " + diagnostic.GetMessage());
Microsoft.Gen.Metrics.Unit.Tests (3)
ParserTests.Diagnostics.cs (3)
35Assert.Contains("Test.TypeB ⇆ Test.TypeA", diag.GetMessage()); 65Assert.Contains("Test.TypeC ⇆ Test.TypeB", diag.GetMessage()); 96Assert.Contains("Test.Transitive ⇆ Test.Interim", diag.GetMessage());
Mvc.Api.Analyzers.Test (1)
ApiConventionAnalyzerIntegrationTest.cs (1)
296Assert.Equal(string.Format(CultureInfo.InvariantCulture, descriptor.MessageFormat.ToString(CultureInfo.InvariantCulture), args), diagnostic.GetMessage(CultureInfo.InvariantCulture));
System.Windows.Forms.Design.Tests (1)
System\Resources\Tools\CodeDomCompileHelper.cs (1)
53throw new InvalidOperationException(string.Join('\n', result.Diagnostics.Select(d => d.GetMessage())));
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
309Assert.False(diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error), $"Failed: {diagnostics.FirstOrDefault()?.GetMessage()}");