Here I will explain how to solve
the problem of “Visual
Studio TFS Key Not Valid for Use in Specified State” while connecting tfs in visual studio. This key
not valid for use in specified state problem occurred due to changing some
login key values.
In previous posts I explained convert string to lower case, upper case and title case in asp.net, jQuery send receive json object from webservice methods, Asp.net mvc complete project with database, download multiple files as zip folder in asp.net and many articles relating to solve errors in asp.net, SQL Server, IIS, etc. Now I will explain how to solve the problem of “key not valid for use in specified state” in visual studio while connecting tfs.
I got this problem suddenly due to some login reset by system administrators. To fix this problem we need to delete TokenStorage folder in registry for that follow below steps
1. First please close all visual studio instances and navigate to following folder
2. Type regedit in search and open it then navigate to TokenStorage folder by using following path.
HKEY_CURRENT_USER à Software à Microsoft à VSCommon à 14.0 or 12.0 based on your vs version à ClientServices à TokenStorage
Now delete this folder and try to open your application in tfs it will ask for login just login again it will fix your problem.