diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg
index 67afbe0a5..349c439e4 100644
--- a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg
+++ b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg
@@ -64,6 +64,7 @@ using IToken = Antlr4.Runtime.IToken;
/// \.
/// \
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "")]
+[System.CLSCompliant(false)]
public interface IListener : IParseTreeListener {
@@ -101,6 +102,7 @@ using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
/// of the available methods.
/// \
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "")]
+[System.CLSCompliant(false)]
public partial class BaseListener : IListener {
@@ -150,6 +152,7 @@ using IToken = Antlr4.Runtime.IToken;
/// \
/// \The return type of the visit operation.\
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "")]
+[System.CLSCompliant(false)]
public interface IVisitor\ : IParseTreeVisitor\ {
@@ -182,6 +185,7 @@ using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
/// \
/// \The return type of the visit operation.\
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "")]
+[System.CLSCompliant(false)]
public partial class BaseVisitor\ : AbstractParseTreeVisitor\, IVisitor\ {
@@ -220,6 +224,7 @@ Parser(parser, funcs, atn, sempredFuncs, superClass) ::= <<
Parser_(parser, funcs, atn, sempredFuncs, ctor, superClass) ::= <<
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "")]
+[System.CLSCompliant(false)]
public abstract partial class : {
public const int
@@ -908,6 +913,7 @@ using DFA = Antlr4.Runtime.Dfa.DFA;
Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= <<
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "")]
+[System.CLSCompliant(false)]
public abstract partial class : {
public const int
=}; separator=", ", wrap, anchor>;