Having difficulties with DotNetTemplateEngine (V2)

Posts   
 
    
mckeogh
User
Posts: 7
Joined: 07-Mar-2005
# Posted on: 06-Jul-2006 16:42:02   

Using Version 2

It's probably just me (it usually is), but I can't get .lpt templates to process properly. It appears that the text from the .lpt file is being inserted in the C# file. For example, if debugBuild is true, the template code

a few lines
to see what we get 

produces

using SD.LLBLGen.Pro.GeneratorCore;
...
using System.IO;


a few lines
to see what we get 
public class DataPortalTemplate : ITemplateClass {
...
    private void __ScriptCode() {
        __outputWriter.Write("a few lines\nto see what we get \n");
    }
...
}

which causes the compiler some grief. I have not had similar problems with Version 1.

Any help gratefully accepted

Kevin McKeogh

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 06-Jul-2006 17:30:11   

Hmm, should be ok. I'll check it out.

(edit) reproduced.

bug in lpttemplateengine.

(edit) fixed in next build

Frans Bouma | Lead developer LLBLGen Pro
mckeogh
User
Posts: 7
Joined: 07-Mar-2005
# Posted on: 07-Jul-2006 13:53:35   

Thanks Frans

That appears to be fixed now

Posts: 1263
Joined: 10-Mar-2006
# Posted on: 20-Jul-2006 03:30:21   

I cannot get mine to work. It definately gave a weird error at compile time, and I updated to the latest versions.

However, I still get compile errors.

If I open the template in template studio and do a compile it compiles fine, but gives compile errors when used from generator - so something is still up with v2.

Alsio, where does the 'templateAssemblySourceFileFormat' file end up? I have never found it to look and even see what it produces.

I will email in the file.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 20-Jul-2006 10:05:29   

The file ends up in the destination folder. I'll check your template.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1263
Joined: 10-Mar-2006
# Posted on: 20-Jul-2006 16:25:10   

I sent this in email, along with my complete bindings file. I wanted to put it here in case others had this problem.

I have a template bindings file in the AdditionalTemplates folder. If I put this in that template binding file:

    <templateBinding templateID="WB.EnhancedActionProcsTemplate" filename="SqlServerSpecific\Net2.x\C#\ActionStoredProcTemplate.lpt" />

Then all of a sudden NO presets work. Not even the shipping ones. It appears it does not matter if you use the template or not it still gives the errors I attached before. Just having a templatebindings file with this line in it present anywhere in the templatebindings path stops llblgen from generating code!

How do I add .lpt template bindings?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 20-Jul-2006 17:51:36   

It's a strange thing. I made a repro case which succeeded, and your bindings file fails. They look almost the same, so it's odd. I'll have a look. It might be a bug in the .lpt engine.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 20-Jul-2006 17:55:10   

Continued via email

(solution was: no . can be present in a templateid, as the templateid will become the class name for the class which handles the lpt template)

Frans Bouma | Lead developer LLBLGen Pro