diff --git a/src/Microsoft.DotNet.GenFacades/SourceGenerator.cs b/src/Microsoft.DotNet.GenFacades/SourceGenerator.cs index f7014698b41..b34212138a4 100644 --- a/src/Microsoft.DotNet.GenFacades/SourceGenerator.cs +++ b/src/Microsoft.DotNet.GenFacades/SourceGenerator.cs @@ -47,7 +47,7 @@ public bool GenerateSource( StringBuilder sb = new StringBuilder(); sb.AppendLine("// "); // Adding this because the following code is autogenerated. - sb.AppendLine("#pragma warning disable CS0618"); // Adding this to avoid warnings while adding typeforwards for obselete types. + sb.AppendLine("#pragma warning disable CS0618,CA2252"); // Adding this to avoid warnings while adding typeforwards for obselete types. CA2252 suppresses warnings on preview APIs bool result = true;