Author Topic: C# code generation - 'File' Template not generated  (Read 1218 times)

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
C# code generation - 'File' Template not generated
« on: March 26, 2010, 01:09:50 am »
When I apply "Generate Code..." to a C# class in my class diagram, it doesn't generate the .cs file header. But it is clearly configured in the Code Generation Editor for C#

File
Code: [Select]
///////////////////////////////////////////////////////////
//  %fileName%
//  Implementation of the %elemType% %className%
//  Generated by Enterprise Architect
//  Created on:      %eaDateTime%
%if classAuthor != ""%
//  Original author: %classAuthor%
%endIf%
///////////////////////////////////////////////////////////\n

$COMMENT="WARNING: DO NOT MODIFY THIS TEMPLATE BELOW THIS POINT"
\n\n
%ImportSection%
%list="Namespace" @separator="\n\n"%

I also set author and specified a file path but the head of the file is empty. It starts with the namespace code, above are two empty lines:



Code: [Select]
namespace eurofins {
      namespace genomics {
            namespace xbo {
                  /// <summary>
                  /// base class for all exchangeable business object classes. needs to be extended by an abstract common base type class (e.g. common 'Order', 'Adress', 'Contact')
                  /// </summary>
                  public abstract class ExchangeableBusinessObject {
...
...
...


I can't find the place where to activate it, perhaps someone has a quick hint for me :-)




Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7571
  • Karma: +94/-18
    • View Profile
Re: C# code generation - 'File' Template not gener
« Reply #1 on: March 26, 2010, 08:52:54 am »
At a guess I would say you are generating to a file that already exists.  In that situation the File template isn't run as is documented at http://www.sparxsystems.com/uml_tool_guide/code_engineering/synchronisingcode.html
Eve

support@sparxsystems.com

pocketom

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: C# code generation - 'File' Template not gener
« Reply #2 on: March 26, 2010, 09:07:58 pm »
Ok, thanks! That was the problem.