title: Query for TFS Stored/Saved query by Full path and Query Name (Queries not in 'My Queries' or 'Shared Queries')
body: <p>I'm trying to access saved TFS queries by their full path (deeper than 'My Queries'/'Shared Queries') , and the query name.</p>
  
  <p>The scenario is that users can add the path to their team directory, and the names of the their work item queries into a config xml file.  I read the xml and get the data.</p>
  
  <p>example XML </p>
  
  <pre><code>&lt;Teams&gt;
    &lt;Team name ="MyTeam"&gt;
      &lt;Query project="MyProj" queryfolder="Shared Queries/blah/blah2/MyTeamFolder" queryName="MyTeams WorkItems - All Workitems"/&gt;
    &lt;/Team&gt;
  &lt;/Teams&gt;
  </code></pre>
  
  <p>I'm looking to use the 'queryfolder' and the 'queryName' to find the query in TFS
  What I have so far, that works for the Root directories ('My Queries'/'Shared Queries'), but I can't figure out how to get something working for deeper paths.</p>
  
  <p>This does not work:</p>
  
  <pre><code>  QueryHierarchy queryRoot = workItemStore.Projects["MyProj"].QueryHierarchy;
                  QueryFolder folder = (QueryFolder)queryRoot["Shared Queries/blah/blah2/MyTeamFolder"];
                  QueryDefinition query = (QueryDefinition)folder["MyTeams WorkItems - All Workitems"];
                  string queryResults = query.QueryText;
  </code></pre>
  
  <p>This will error out on finding the folder <em>QueryFolder folder = (QueryFolder)queryRoot[".."]</em></p>
  
  <p>with <em>KeyNotFoundException</em></p>
  
  <p>changing the folder with 'Shared Queries' or 'My Queries', its able to find the folder, but then would get the same exception when trying to find the Query by its' name.  And as expected, if the query is located in the root folder (shared/my queries), it works fine.</p>
  
  <p>So how do I search deeper than just the root folder?</p>
  
  <p>(all internet searches so far have yielded only examples where the root folder is being used)</p>