diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 296e5dd3..cf6e6601 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -655,7 +655,8 @@ namespace CppSharp.Generators.CSharp { Write("public "); - if (@class != null && @class.NeedsBase && !@class.BaseClass.IsInterface && !@class.IsDependent) + if (@class != null && @class.NeedsBase && !@class.BaseClass.IsInterface && + !(@class is ClassTemplateSpecialization)) Write("new "); var templateSpecialization = @class as ClassTemplateSpecialization; diff --git a/tests/CSharp/CSharpTemplates.h b/tests/CSharp/CSharpTemplates.h index 6fc9a0a6..fc55cd01 100644 --- a/tests/CSharp/CSharpTemplates.h +++ b/tests/CSharp/CSharpTemplates.h @@ -9,7 +9,7 @@ class DLL_API T2 }; template -class DLL_API IndependentFields +class DLL_API IndependentFields : public T1 { private: int field;