Team System Developer Center > Visual Studio Team System Forums > Team Foundation Server - General > WorkItemStore.Projects returning Value does not fall within the expected range
Ask a questionAsk a question
 

AnswerWorkItemStore.Projects returning Value does not fall within the expected range

  • Monday, November 02, 2009 9:18 PMjeffjeffjeff Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Not sure if this is the correct forum, so please direct me if it's not.

    We are using TFS 2005, and I have written code that allows us to automatically create bugs when different events happen.  This code has been running exceptionally well for the last year.  All of a sudden I am getting the error message

    Value does not fall within the expected range. at Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.HandleComException

    When I set a breakpoint, the Project collection has this error message.  Very strange.

    Dim ProjectName As String = "My Project"
    Dim tfs As New TeamFoundationServer("http://tfs001:8080/", New Net.NetworkCredential("username", "password", "domain"))
    tfs.Authenticate()
    Dim store As WorkItemStore = CType(tfs.GetService(GetType(Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore)), Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore)
    Dim selectedProject As Project =
    Nothing
    For Each st As Project In store.Projects
       If st.Name.Trim.ToLower = ProjectName.Trim.ToLower
    Then
          selectedProject = st
          Exit
    For
       End
    If
    Next

    Thanks!
    Jeff

Answers

All Replies