From 303d9e3d1237631ed8b51fb762f5c84e5ea01d20 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Mon, 12 Feb 2024 22:27:31 -0500 Subject: [PATCH] Added disable warnings around bad api --- .../Core/IncrementalGenerator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SourceGenerator.Foundations.Shared/Core/IncrementalGenerator.cs b/src/SourceGenerator.Foundations.Shared/Core/IncrementalGenerator.cs index a2d1cd6..fb6e7b3 100644 --- a/src/SourceGenerator.Foundations.Shared/Core/IncrementalGenerator.cs +++ b/src/SourceGenerator.Foundations.Shared/Core/IncrementalGenerator.cs @@ -63,11 +63,12 @@ private ILogger CreateLogger(string sourceContext) logger.AddSink(sink); } } - +#pragma warning disable RS1035 // Do not use APIs banned for analyzers if (Environment.UserInteractive) { logger.AddSink(); } +#pragma warning restore RS1035 // Do not use APIs banned for analyzers return logger; } @@ -156,7 +157,9 @@ private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e) Assembly? assembly = null; try { +#pragma warning disable RS1035 // Do not use APIs banned for analyzers assembly = Assembly.Load(platformAssembly); +#pragma warning restore RS1035 // Do not use APIs banned for analyzers Type? platformType = assembly? .GetTypes() .Where(typeof(IDevelopmentPlatform).IsAssignableFrom)