If you have extended Team Explorer 2012 through your Visual Studio extension, I am sure you would have referred code from this article. The code in that article provides you all the necessary infrastructure to quickly integrate your extension with Team Explorer in Visual Studio 2012. However, with Visual Studio 2013 RC released, you will face an issue if you use the same base project to migrate your extension to Visual Studio 2013. So, in this blog post I will let you know what is the issue you will encounter, cause for it and how to resolve it.


“InvalidCastException error in GetService method”

Additional information: Unable to cast object of type Microsoft.VisualStudio.Services.Integration.ContextManager to type Microsoft.TeamFoundation.Client.ITeamFoundationContextManager



The project is referencing Visual Studio 2012 assemblies.


Refer to Visual Studio 2013 assemblies

  1. Remove the following assembly references from the TeamExplorerIntegration project.


  1. Refer to the Visual Studio 2013 assemblies. The above three assemblies are present in below path

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies

[Update] For detailed steps on how to upgrade Visual Studio 2012 extension to Visual Studio 2013, please refer my friend Tarun’s great post.

About author
Utkarsh Shigihalli
Utkarsh Shigihalli
Utkarsh is passionate about software development and has experience in the areas of Azure, Azure DevOps, C# and TypeScript. Over the years he has worked as an architect, independent consultant and manager in many countries including India, United States, Netherlands and United Kingdom. He is a Microsoft MVP and has developed numerous extensions for Visual Studio, Visual Studio Code and Azure DevOps.
We Are
  • onlyutkarsh
    Utkarsh Shigihalli
    Microsoft MVP, Technologist & DevOps Coach

  • arora_tarun
    Tarun Arora
    Microsoft MVP, Author & DevOps Coach at Avanade

Do you like our posts? Subscribe to our newsletter!
Our Book