I've added some custom settings to frameworksettings file and want to use them as placeholders in task parameters, e.g. a setting named Foo would be usable as a task performer parameter by specifying it as [Foo] (the same way default placeholders work).
To do this, I've inherited the DotNetTemplateEngine (the project is using .NET Framework 4.5.2) and overriden the Perform method in the following manner:
public override void Perform(
IGenerator executingGenerator,
ITask taskDefinition, Dictionary<string, TaskParameter> parameters)
{
var configReader = ProjectConfigurationReader.Create(executingGenerator.ProjectDefinition);
var resolvedParameters = this.paramResolver.ResolveParams(configReader, parameters);
base.Perform(executingGenerator, taskDefinition, resolvedParameters);
}
The ProjectConfigurationReader and ParamResolver are just helper classes which go through the placeholder parameter values and replace them with the values from project definition custom settings.
I've done everything needed to use this custom task performer in the designer (specified custom task performers folder with the resulting dll in it, created custom task definition, created custom templates and templatebindings etc.), but when generating the code the designer shows that there's been an error while compiling the templates: "The type or namespace name 'ITemplateClass' could not be found (are you missing a using directive or an assembly reference?)".
This error doesn't happen if there's at least one task which uses the original DotNetTemplateEngine task performer before my custom task in the designer task queue.
ITemplateClass is located in SD.LLBLGen.Pro.LptParser, so what this error is indicating that the compiler doesn't have an assembly reference to SD.LLBLGen.Pro.LptParser.dll when compiling the template, but the docs state what I've pasted below so I guess the reference should already be there.
From 4.2 docs:
The following assemblies are already referenced by the code produced by the DotNetTemplateEngine:
SD.LLBLGen.Pro.GeneratorCore.dll
SD.LLBLGen.Pro.ApplicationCore.dll
SD.LLBLGen.Pro.DBDriverCore.dll
SD.LLBLGen.Pro.LptParser.dll
SD.LLBLGen.Pro.Core.dll
SD.Tools.Algorithmia.dll
SD.Tools.BCLExtensions.dll
mscorlib
System.dll
System.Core.dll
System.Data.dll
I've tried copying the SD.LLBLGen.Pro.LptParser assembly to the custom task performers folder as well as all folders which are specified as probing path in the designer configuration file (e.g. ReferencedAssemblies), and adding an assembly reference declaration in the template as specified below, but with no luck.
<$ SD.LLBLGen.Pro.LptParser.dll $>
The only thing that worked is specifying the full path to the assembly:
<$ C:\Program Files (x86)\Solutions Design\LLBLGen Pro v4.2\TaskPerformers\SD.LLBLGen.Pro.LptParser.dll $>
I'm wondering if there's a way not to have to add that declaration to the custom templates or at least just use the assembly name without the full path?