TransformationException was unhandled

Oct 26, 2010 at 4:31 AM

I'm very excited to start using preprocessed generators and templates in VS2010, but I'm running into some problems.

I've started by creating a console application to be my code generation project.  My "Main" method creates an instance of my generator, and my generator creates a template.  But when I call "Run()" on my preprocessed generator I get a TransformationException with the message: "Transformation context was not properly initialized. Please make sure your template uses the following directive: <#@ include file="T4Toolbox.tt" #>."  I tried putting that directive in my preprocessed template but then I can't build and run my generation project.  I get an error: "Method must have a return type".

What am I doing wrong?  If needed I can add some code that recreates the problem.

Thanks.