Exception on second code gen attempt

Posts   
 
    
Posts: 56
Joined: 08-Jun-2010
# Posted on: 01-Jul-2010 11:50:15   

I am using llblgen 3 with some custom templates which I have just migrated from 2.6.

If I open llblgen, open my prohject and generate the code everything works fine and I get the generated code as expected.

If I run the generator for a second (or more) times I get an error message

"Code generation cycle failed"

Compilation of templates threw errors: Error CS0016, at line: 0, pos: 0: Could not write to output file 'c:\Users\brettb\AppData\Local\Temp\2D18D138-1DD2-467E-86CC-4838250611AE\LptTemplateAssembly.dll' -- 'The process cannot access the file because it is being used by another process. '

Closing down llblgen and starting again solves the problem but it is a bit annoying!

~Brett

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 01-Jul-2010 12:46:14   

I can't reproduce it, code generation runs fine multiple times in a row... Do you use your own task performers ?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 56
Joined: 08-Jun-2010
# Posted on: 01-Jul-2010 13:03:20   

I have my own task performer (I derived a task performer from the lpt one to support the[ProjectName] tag in the filenameFormat parameter)

I've taken all references to my task performer out but It hasn't made any difference. First run works fine, second fails.

Posts: 56
Joined: 08-Jun-2010
# Posted on: 01-Jul-2010 13:06:35   

Also I've just tested it with your standard presets and this works fine. It seems to be an issue with my tasks / presets somewhere

Posts: 56
Joined: 08-Jun-2010
# Posted on: 01-Jul-2010 13:20:04   

I think I've isolated the issue. If I remove the "debug" parameters from my task definition the problem goes away.

eg in my first .lpt I have the following

<parameter isOptional="false" name="debugBuild" defaultValue="true" /> <parameter isOptional="false" name="templateAssemblySourceFileFormat" DefaultValue="templateClassesSource.[extension]" />

Has debugging changed since 2.6?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 01-Jul-2010 16:09:16   

Aha! simple_smile

If you click the 'Start Generator (debug)' button in the generator configuration dialog (the middle button), you'll get a debug build automatically, so we made this easier. Do you then still run into this?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 56
Joined: 08-Jun-2010
# Posted on: 01-Jul-2010 16:57:00   

If I "Start Generator (debug)" it fails on the second attempt.

This is without those parameters in my .task file.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 01-Jul-2010 19:06:01   

BrettBailey wrote:

If I "Start Generator (debug)" it fails on the second attempt.

This is without those parameters in my .task file.

OK, we'll see if we can reproduce this.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 02-Jul-2010 09:39:14   

Reproduced...

(edit) fixed in next build.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 56
Joined: 08-Jun-2010
# Posted on: 02-Jul-2010 10:51:05   

Thanks!

I don't suppose you would consider adding support for the [ProjectName] tag in the filenameFormat parameter? Its a trivial bit of code but would mean I could get rid of my custom task performer

~Brett

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 02-Jul-2010 11:31:23   

BrettBailey wrote:

Thanks!

I don't suppose you would consider adding support for the [ProjectName] tag in the filenameFormat parameter? Its a trivial bit of code but would mean I could get rid of my custom task performer

~Brett

That's already done, use [containerName]

When you use groupusage as visualization mechanism (everything in 1 project) it's the project file. If you use groups as 1 project per group, it's the group name (as multiple projects are created)

Frans Bouma | Lead developer LLBLGen Pro
Posts: 56
Joined: 08-Jun-2010
# Posted on: 02-Jul-2010 11:44:20   

Thanks Frans

I' don't really follow you in terms of project groups and visualization (are you talking task groups llblgen projects / vis studio projects?)

on the plus side I replaced all my [projectName] with [containerName] and I got the results I was expecting so thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 02-Jul-2010 12:06:01   

BrettBailey wrote:

Thanks Frans

I' don't really follow you in terms of project groups and visualization (are you talking task groups llblgen projects / vis studio projects?)

Groups in the designer. You can group entities in the designer, and generate per group code as a vs.net project instead of all entities in a single project.

Frans Bouma | Lead developer LLBLGen Pro