Closed vvdb-architecture closed 5 months ago
The code generated in Program.cs for a database migration tool declares the Main method as follows:
Program.cs
Main
static void Main(string[] args)
and that method ends with:
app.Execute(args);
A command is implemented to return 0 on success and -1 on failure:
app.Command("...", config => { config.Description = "..."; config.OnExecute(() => { try { // whatever code here. return 0; } catch (Exception ex) { Console.WriteLine(ex.Message); return -1; } }); });
The DevOps release pipelines are coded in such a way that process return values different from 0 will cause the migration step to fail.
Unfortunately, this will never happen: because of the void Main declaration, the process always returns 0.
void Main
To fix this, you need to declare the Main method as follows:
static int Main(string[] args)
and the last line should just return the value of the command that has been applied:
return app.Execute(args);
Methinks this is a template issue.
Updated on the templating project. Will be part of the templating changes. Thanks.
Confirmed fixed in ACC
The code generated in
Program.cs
for a database migration tool declares theMain
method as follows:and that method ends with:
A command is implemented to return 0 on success and -1 on failure:
The DevOps release pipelines are coded in such a way that process return values different from 0 will cause the migration step to fail.
Unfortunately, this will never happen: because of the
void Main
declaration, the process always returns 0.To fix this, you need to declare the
Main
method as follows:and the last line should just return the value of the command that has been applied:
Methinks this is a template issue.