Your code doesn't make any sense. If the user doesn't pass in any args, it starts a Windows Forms app.
If the user does pass in arguments, you add every argument to what appears to be a List (I have no idea because you never show the definition of mainObject!), assign the first two arguments to two different variables even if only 1 argument is supplied(!) and then throw all of that out and do nothing with any of it.
Oh, and you're code is missing a closing curly brace just before the catch statement.
One way of assigning arguments to individual variables is to check for the number of arguments:
string argHTTPS = string.Empty;
string argCustDbName = string.Empty;
if (args.Count() > 0)
{
argHTTPS = args[0];
}
if (args.Count() > 1)
{
argCustDbName = args[1];
}
But, like I said, you're not doing anything with these variables and I have no idea what mainObject is, so I think you're doing something that you should not be doing in the Main method of your startup code.