Registering, queueing, and deregistering a TFS job
If you try to install the job the way you used to in TFS 2013, you will now get the TF400444
error:
TF400444: The creation and deletion of jobs is no longer supported. You may only update the EnabledState or Schedule of a job. Failed to create, delete or update job id 5a7a01e0-fff1-44ee-88c3-b33589d8d3b3
This is because they have made some changes to the job service, for security reasons, and these changes prevent you from using the Client Object Model. You are now forced to use the Server Object Model.
The code that you have to write is slightly more complicated and requires you to copy your executable to multiple locations to get it working properly. Place all of the following code in your program.cs
file inside the main
method.
We start off by getting some arguments that are passed through to the application, and if we don't get at least one argument, we don't continue:
#region Collect commands from the args if (args.Length != 1 &&...