Custom template

Posts   
 
    
andreister
User
Posts: 10
Joined: 06-Jun-2008
# Posted on: 09-Jun-2008 15:58:18   

I'm trying to add a custom template without Template Studio.

So, I've 1. created a template file (Templates\SharedTemplates\Net2.x\C#\zzz.template) and a templatebindings file (Templates\zzz.templatebindings) 2. updated a preset task I'm using for generating the code: appended it with my task call

...
<taskGroupPreset name="Zzz.Tasks.Adapter.FileCreators">
      <taskPreset name="Zzz.Tasks.Adapter.LLBLGenGenerator">
        <parameters>
          <parameter name="destinationFolder" value="[dbspecificSubFolder]" />
          <parameter name="templateID" value="zzzTemplate" />
        </parameters>
      </taskPreset>
</taskGroupPreset>

  1. created a Zzz.Tasks.Adapter.tasks file in Tasks folder (the mentioned preset file sits there) and put the task there.

I was assuming it was everything I needed but my file isn't generated.

On the other hand, I was able to generate it by updating the default templatebindings, but I'd better off not modifying shipped files.

So, what am I missing?

andreister
User
Posts: 10
Joined: 06-Jun-2008
# Posted on: 09-Jun-2008 16:06:02   

Just noticed there's a list of template bindings on the UI (Project->Generate in LLBLGenPro) - apparently I'd need to add my zzz.templatebindings therein, yet not sure how.

andreister
User
Posts: 10
Joined: 06-Jun-2008
# Posted on: 09-Jun-2008 16:25:12   

sunglasses works fine after I removed databaseDriverID reference from my custom templatesbindings.

BTW, why? all shipped templatebindings do have that param..

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 09-Jun-2008 17:32:23   

The databasedriverid is used to filter out templates which aren't usable for the target db in the project. So if you for example have an ms access based project, you can't use CF.NET projects as there's no CF.NET DQE for access dbs. simple_smile

So if you add a databasedriverid to the templatebindings which is different from the one of your database used in the project, the templatebindings are filtered out and therefore not used.

Frans Bouma | Lead developer LLBLGen Pro