diff --git a/src/Analyzers/Analyzers/test/StartupAnalyzerTest.cs b/src/Analyzers/Analyzers/test/StartupAnalyzerTest.cs index cead987fabe0..188352e795e1 100644 --- a/src/Analyzers/Analyzers/test/StartupAnalyzerTest.cs +++ b/src/Analyzers/Analyzers/test/StartupAnalyzerTest.cs @@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Analyzers; -public abstract class StartupAnalyzerTest +public class StartupAnalyzerTest { public StartupAnalyzerTest() { @@ -658,6 +658,8 @@ private Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expect TestCode = source, ReferenceAssemblies = TestReferences.EmptyReferenceAssemblies, }; + // Tests are just the Configure/ConfigureServices methods, no Main, so we need to mark the output as not console + test.TestState.OutputKind = OutputKind.DynamicallyLinkedLibrary; test.ExpectedDiagnostics.AddRange(expected); return test.RunAsync();