Ensure custom templates are only used for a specific project

Posts   
 
    
Kevinksy
User
Posts: 27
Joined: 05-Jun-2013
# Posted on: 25-Sep-2013 19:51:24   

I inherited a LLBLgen 2.0 project which makes extensive use of templates to generate domain transfer objects. I updated the 2.0 project to the 4.0 version thanks to the converter with no problems. When I generate code with template settings set to SelfServicing and preset SD.Presets.SelfServicing.General the generated code compiles in Visual Studio.

When I add the custom template bindings which call various custom templates and change the LLBLGen setting File/Preferences/DesignerBehaviour/AdditionalTemplatesFolder to point to these files the same project will not compile under Visual Studio. The error is ""Member with the same name is declared already". This code comes from a custom template called CustomEntity.template.

If I remove the custom template bindings and run the project again the generated code will compile under Visual Studio.

I tried changing the order of the template bindings in the Advanced Settings for Code generation but it made no difference.

It appears that the template is being used even when it is not called in the template binding. Is this even possible?

How do I ensure that the only templates that are used are the ones I specify?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 26-Sep-2013 12:07:20   

A template used at generation time always has to be bound to an id by a templatebindings file in-scope, so a binding file which is listed at tab 2 on the code generation configuration dialog.

Please click each binding file and check in the listing below it (at tab 2) whether the template you're referring to is in the list of bindings.

Frans Bouma | Lead developer LLBLGen Pro