llblgenprollblgen

How to specify AssemblyVersion in LLBLGen?


I'm using LLBL Gen Pro 3.5 command line (CLIRefresher and CLIGenerator) to create the solutions.

It automatically creates a AssemblyInfo.cs which contains this code:

AssemblyVersion("1.0")

I want to set it to another version while building the project. For example:

AssemblyVersion("2.1.0.234")

Question1: How can I tell LLBL to create the project with this version?

Question2: If it is not possible, how can I tell LLBL NOT to create this file, so I can add this file later using MSBuild?


Solution

  • A1: you can, through a custom template for assemblyinfo. It's bound in the file SD.TemplateBindings.SharedTemplates.templatebindings in the folder \Frameworks\LLBLGen Pro\Templates

    You can define a new binding by creating a new templatebindings file, store it in the folder you define as 'AdditionalTemplates' folder in the project properties, and you should give that templatebindings folder a higher precedence than the one you're 'overriding' (or move it up in tab 2 on the code generator config dialog). See the SDK docs for details.

    A2: It is possible, see A1. But here's the thing: this file is written once (done in the preset you're using to generate code). If the file exists the next time you generate code, it's left alone. This means that if you change it, e.g. by giving it a different version number, it won't be overwritten.

    So while you could change the template easily, in this case it's not needed: you can do whatever you want with the file after it's been generated, it's not generated again.

    (ps: please ask questions about LLBLGen Pro on our forums at http://www.llblgen.com/tinyforum, as we don't monitor stackoverflow that regularly. Thanks)