Answered TfsTeamProjectCollection

  • 2011年6月23日 7:16
     
     

    I m using TfsTeamProjectCollection class.

    TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri("TeamProjectCollectionURL"));

    But. It would produce a compile error like this "The type or namespace name 'TfsTeamProjectCollection' could not be found (are you missing a using directive or an assembly reference?)".

    Although, I referenced "Microsoft.TeamFoundation.Client" dll  in my project.

    Also, I checked this class is available or not in Microsoft.TeamFoundation.Client it was missed. (I confused.)

     

    Anybody help me what should I do.

     

    Thanks,

        Anand

     


    • 已移动 Yi Feng Li 2011年6月28日 3:00 TFS issue (From:Visual Studio Extensibility)
    •  

全部回复

  • 2011年6月23日 16:12
     
     

    Do you have a using statement for the Microsoft.TeamFoundation.Client namespace?  Where are you getting the dll from for your reference?  What version of VS are you using?

    Ryan

  • 2011年6月24日 8:15
     
     

    Ryan,

    I m using Visual Studio 2008 and TFS SDK Setup from Microsoft Links.

    Regards,

          Anand

     


    Anandakumar Muthusamy
  • 2011年6月28日 6:12
    版主
     
     已答复

    Hello Anand,

    Thanks for your post.

    What version of TFS are you using? TFS2008 or TFS2010?

    If you are using TFS2010, you should install VS2010 team explorer to have the appropriate version TFS2010 SDK. You can download the VS2010 Team Explorer here:

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=329

    And you can get the Microsoft.VisualStudio.TeamFoundation.Client.dll in the path: <diver>:\Program Files(x86)\Microsoft\Visual Studio 10.0\Common 7\IDE\PrivateAssemblies.

    If you are using TFS2008, I am sorry there is no team project collection concept in the TFS2008. So instead of using

    TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri("TeamProjectCollectionURL"))

    to connect to TFS2008, you should use

    TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("Your Server Name");

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • 2011年6月28日 9:02
     
     
    Yes Vicky. You are correct. Thanks for your reply.
    Anandakumar Muthusamy