|
This question has been asked before but I have a new twist for you. Looking to pass my own custom objects to a t4 template by calling TextTemplateAction from within my own Action class. The problem is that TextTemplateAction.Configure() takes a StringDictionary for the template args. Are there any other ways to pass this along? I've basically done the following
1. Set up a RecipeArgument based on my custom objects type.
2. Specified that my custom action (the one which calls TextTemplateAction) should receive this RecipeArgument.
3. Configured the template to import namespaces and set assembly references to the custom object and attempted to use an instance of it within the template.
This results in
=============================================================================
Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe GenerateEntity. Error was: Action ProcessRegionValueObject failed to execute: Exception of type 'Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TemplateException' was thrown.. You can remove the reference to this recipe through the Guidance Package Manager. ---> warning : An Exception was thrown while processing a directive named 'Property'. The following Exception was thrown: System.ArgumentNullException:
Template uses property name which has not been received for execution. Parameter name: CodeGenOptions
at Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.PropertiesDirectiveProcessor.ProcessDirective(String directiveName, IDictionary`2 arguments) at
===============================================================================
Should I just try and pull the instance from the Dictionary service within the Template itself?
Any ideas would be greatly appreciate (we're stuck here)
Thanks,
Travis
Travis |