TFS Integration Tools – Issue: Sequence contains no elements

Audience

Everyone

According to TFS Integration Tools – March 2012 Release there was a fix for “Resolving VC namespace conflicts results in System.InvalidOperationException: Sequence contains no elements” in the March release. I am using the March release and:

image
Figure: Sequence contains no elements

Applies to

  • TFS Integration Tools (March 2012 Release)

Findings

On examining the log files it looks like the Migration Shell is trying to load the TFS 2008 VC Adapter even though we are using the TFS 2012 VS Adapter. As I do not have anything to do with TFS 2008 installed I get, as you would expect, an “Unable to load one or more of the requested types”.

Application Information: 0 : Microsoft.TeamFoundation.Migration.Shell, Version=2.2.20314.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Application Error: 0 : A failure occurred while trying to load the C:Program Files (x86)Microsoft Team Foundation Server Integration ToolsPluginsTfs2008VCAdapter.dll Plugin:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at Microsoft.TeamFoundation.Migration.Shell.Extensibility.PluginManager.DiscoverPlugins(DirectoryInfo[] probingDirectories)
Application Error: 0 : A failure occurred while trying to load the C:Program Files (x86)Microsoft Team Foundation Server Integration ToolsPluginsTfs2008WITAdapter.dll Plugin:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at Microsoft.TeamFoundation.Migration.Shell.Extensibility.PluginManager.DiscoverPlugins(DirectoryInfo[] probingDirectories)
Application Error: 0 : [8/21/2012 5:34:01 PM] System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__0[TResult](IEnumerable`1 sequence)
   at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
   at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
   at System.Linq.Queryable.First[TSource](IQueryable`1 source)
   at Microsoft.TeamFoundation.Migration.Toolkit.SqlChangeGroupManager.UpdateConversionHistoryAndRemovePendingChangeGroups(String migrationInstructionName, String deltaTableName, String comment)
   at Microsoft.TeamFoundation.Migration.Toolkit.ChangeGroupService.UpdateConversionHistoryAndRemovePendingChangeGroups(String migrationInstructionName, String deltaTableName, String comment)
   at Microsoft.TeamFoundation.Migration.TfsVCAdapterCommon.TfsCheckinFailureConflictHandler.updateConversionHistory(MigrationConflict conflict, ConflictResolutionRule rule, IServiceContainer serviceContainer)
   at Microsoft.TeamFoundation.Migration.TfsVCAdapterCommon.TfsCheckinFailureConflictHandler.Resolve(IServiceContainer serviceContainer, MigrationConflict conflict, ConflictResolutionRule rule, List`1& actions)
   at Microsoft.TeamFoundation.Migration.Toolkit.ConflictManager.ResolveExistingConflict(RuntimeEntityModel context, ConflictResolutionRule newRule, ConflictResolutionResult defaultResult, RTConflict rtConflict, Guid conflictTypeRefName, Boolean newResolutionRule)
   at Microsoft.TeamFoundation.Migration.Toolkit.ConflictManager.ResolveExistingConflictWithNewRule(Int32 internalConflictId, ConflictResolutionRule newRule)
   at Microsoft.TeamFoundation.Migration.Shell.ConflictManagement.ConflictRuleViewModel.Save()
   at Microsoft.TeamFoundation.Migration.Shell.ConflictManagement.ConflictListView.btnResolve_Click(Object sender, RoutedEventArgs e)
Application Error: 0 : [8/21/2012 5:34:33 PM] System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__0[TResult](IEnumerable`1 sequence)
   at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
   at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
   at System.Linq.Queryable.First[TSource](IQueryable`1 source)
   at Microsoft.TeamFoundation.Migration.Toolkit.SqlChangeGroupManager.UpdateConversionHistoryAndRemovePendingChangeGroups(String migrationInstructionName, String deltaTableName, String comment)
   at Microsoft.TeamFoundation.Migration.Toolkit.ChangeGroupService.UpdateConversionHistoryAndRemovePendingChangeGroups(String migrationInstructionName, String deltaTableName, String comment)
   at Microsoft.TeamFoundation.Migration.TfsVCAdapterCommon.TfsCheckinFailureConflictHandler.updateConversionHistory(MigrationConflict conflict, ConflictResolutionRule rule, IServiceContainer serviceContainer)
   at Microsoft.TeamFoundation.Migration.TfsVCAdapterCommon.TfsCheckinFailureConflictHandler.Resolve(IServiceContainer serviceContainer, MigrationConflict conflict, ConflictResolutionRule rule, List`1& actions)
   at Microsoft.TeamFoundation.Migration.Toolkit.ConflictManager.ResolveExistingConflict(RuntimeEntityModel context, ConflictResolutionRule newRule, ConflictResolutionResult defaultResult, RTConflict rtConflict, Guid conflictTypeRefName, Boolean newResolutionRule)
   at Microsoft.TeamFoundation.Migration.Toolkit.ConflictManager.ResolveExistingConflictWithNewRule(Int32 internalConflictId, ConflictResolutionRule newRule)
   at Microsoft.TeamFoundation.Migration.Shell.ConflictManagement.ConflictRuleViewModel.Save()
   at Microsoft.TeamFoundation.Migration.Shell.ConflictManagement.ConflictListView.btnResolve_Click(Object sender, RoutedEventArgs e)

Well that sucks…

Workaround

One work around that I found with the help of Bill Essary is to remove the “Tfs2008VCAdapter.dll” files from the folder so that they can’t even be loaded.

image
Figure: Get rid of the offending adapters

  1. Create new folder called “NOT NEEDED” under “C:Program Files (x86)Microsoft Team Foundation Server Integration ToolsPlugins”
  2. Move all files from “Plugins” that have 2008 in the title to this folder.
  3. Rerun action…

Woot… that solved my issue… did it solve yours?

Create a conversation around this article

Share on Facebook
Share on Twitter
Share on Linkdin

Read more

Martin Hinshelwood
In organizational development and team dynamics, Agile (as the Agile Manifesto delineates) and Scrum (as the Scrum Guide outlines) guide teams not by solving their problems but by illuminating the issues that demand attention. These frameworks aim to identify and spotlight the challenges within a team or organization’s processes, effectively …
Martin Hinshelwood
This week, I participated in a Scrum.org Webinar hosted by Sabrina Love (Scrum.org Product Owner) as well as my colleagues, Joanna Płaskonka, Ph.D. and Alex Ballarin to discuss the state of learning and how immersive learning is the future of training. You can watch the video below to hear what …
Martin Hinshelwood
For a long time now I have been searching for that perfect domain that epitomised the vision, the why, of what I am trying to achieve with my customers and the industry at large. Now I have found it in http://nkdagility.com
Martin Hinshelwood
At the MVP Summit I was appalled by the number of people who asked questions about new features for supporting hierarchical tasks! I shared a disgusted look with Peter Provost and we had a quick (and I mean really quick) conversation that resulted in this post. it really comes down …