none
how to Get attachments from Shared steps in TFS

    Pertanyaan

  • How to download attachments in shared steps from TFS using C#. here is somepart of code i have written.. attachment is not coming up. Let me know if anyone knows

    foreach (WorkItem item in witCollection) //witCollection is collection of shared steps.

    {

    if(item.Attachments.Count > 0)

    {
    AttachmentCollection atcoll =((Microsoft.TeamFoundation.WorkItemTracking.Client.AttachmentCollection)(item.Attachments)) as AttachmentCollection;

      foreach (var attachment in atcoll )
    {
    
    }
    }


    Rabu, 03 Oktober 2018 03.53

Semua Balasan

  • Hi,

    You are doing it wrong. You are looping through Test Case work item however you need to loop through ISharedTestStepResult collection and then fetch attachments if available.

    See below couple of threads - 

    Thread 1

    Thread 2

    Also you can go through my blog posts.


    Thanks,
    Vivek Bansod
    Blog | MSDN | LinkedIn
     


    Rabu, 03 Oktober 2018 10.53
  • Questions related to TFS should be posted on Stack Overflow. The TFS team has moved their support there.

    As a starting point though feel free to take a look at the code I wrote to migrate from TFS to VSTS. LePastis added support for migrating attachments as well. That code demos how you can get attachments from work items.


    Michael Taylor http://www.michaeltaylorp3.net

    Rabu, 03 Oktober 2018 14.09