From 2b17ddee0cf8bcc7aad2f33242649a7463915369 Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Sun, 8 Dec 2024 22:31:04 -0500 Subject: [PATCH] Fixed the compiler error due to using the environment --- .../Templates/SourceGeneratorHoistBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SourceGenerator.Foundations/Templates/SourceGeneratorHoistBase.cs b/src/SourceGenerator.Foundations/Templates/SourceGeneratorHoistBase.cs index bce06dd..1a637db 100644 --- a/src/SourceGenerator.Foundations/Templates/SourceGeneratorHoistBase.cs +++ b/src/SourceGenerator.Foundations/Templates/SourceGeneratorHoistBase.cs @@ -35,11 +35,13 @@ internal abstract class SourceGeneratorHoist static SourceGeneratorHoist() { +#pragma warning disable RS1035 // Do not use APIs banned for analyzers if(bool.TryParse(System.Environment.GetEnvironmentVariable("SGF_DEBUGGER_LAUNCH"), out bool launchDebugger) && launchDebugger) { System.Diagnostics.Debugger.Launch(); } +#pragma warning restore RS1035 // Do not use APIs banned for analyzers s_assembliesWithResources = new List();