Search code examples
c#tfstfs-process-template

Tfs 2018 upload process template through c#


I would like to upload a custom process template(zip file) through C# code to TFS I've been searching through the documentation but couldn't really find any proper way or rather any way to do it from pure c# code (I would rather not use power shell script) I use the built-in method that should be uploading the process template but its just won't work!

Thanks in forward!


Solution

  • IProcessTemplates.AddUpdateTemplate():
    name: get it from the ProcessTemplate.xml
    description: same
    metadata: the OuterXml node of the metadata node
    state: "Visible"
    zipFileName: I prefer the full path to the zip file.
    

    Get the IProcessTemplates instance from a TfsTeamProjectCollection instance with the GetService<<T>T>() method.