diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index c513a3e3ff..8ed89aae63 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -149,6 +149,9 @@ group s by s.TemplatedDecl.TemplatedClass into template UnindentAndWriteCloseBrace(); PopBlock(NewLineKind.BeforeNextBlock); } + + if (Options.GenerationOutputMode == GenerationOutputMode.FilePerUnit) + Module.ExternalClassTemplateSpecializations.Clear(); } public virtual void GenerateUsings()