I have at least resolve the null reference error issue.
If anyone else is having the same battle, try setting all slashes/backslashes consistently. You can't just take a command line output that worked and feed the arguments back in - you have to standardize on '/' or '' for all config parameters, according to the type of build agent running the pipeline.