Is there any progress? We're converting our CodeSmith cst files from v2 to v5. For the most part it works but a key file has this error:
System.NullReferenceException: Object reference not set to an instance of an object.
at CodeSmith.Engine.CodeTemplate..ctor()
at _CodeSmith.GenerateCode_cst.GetTemplate(String templateType) in c:\CodeGenOrig\CodeGen\GenerateCode.cst:line 65
at _CodeSmith.GenerateCode_cst.Go() in c:\CodeGenOrig\CodeGen\GenerateCode.cst:line 191
at _CodeSmith.GenerateCode_cst.__RenderMethod1(TextWriter writer, Control control) in c:\CodeGenOrig\CodeGen\GenerateCode.cst:line 291
at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
at CodeSmith.Engine.Control.Render(TextWriter writer)
at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
at CodeSmith.Engine.CodeTemplate.RenderToString()
at CodeSmith.Gui.CodeTemplateGenerator.f(Object A_0, EventArgs A_1)
Line 65 is:
CodeTemplate currentTemplate = new CodeTemplate();
What we want to do is create an empty template then assign a particular template to that variable in a switch statement.
(example) currentTemplate = this.CompileTemplate(this.CodeTemplateInfo.DirectoryName + "_DataAccessLayer.cst");