CodeLens and Team Project Rename

On April 24th, Brian announced the availability of Team Project Rename in Visual Studio Online. This is now available in Team Foundation Server 2015 RC as well. The good news is that CodeLens just works after you rename a project. When you re-open a file after renaming its team project, you will see all its history – including the changes made before the rename .

NOTE: If you need to rename a project, I recommend that you read the MSDN article Rename a Team Project in its entirety and follow all the guidelines there.

I described the CodeLens processing pipeline in an earlier post. After a team project rename, we do not perform any additional CodeLens processing. The existing CodeLens files are used to display the correct indicators, so there is no additional processing or network overhead .

However, in a particular case after renaming a team project, you may need to re-index the CodeLens data. Let me explain why with a concrete example. In the schematic below, at time T, there are two team projects – A and X. After m number of days, project A is renamed to B and project X is renamed to Y. Then, after n number of days, project B is renamed to X. This means that the team project name X has effectively been reused.


CodeLens will not be able to correctly determine the indicators for files in team project X because there is CodeLens data stored for the original project named X and the newly renamed project X (which was originally named A). In addition, CodeLens will not be able to determine the correct indicators for files in project Y because these files have references to the original project X.

In such cases, you must re-index the data in the new team projects X and Y. If you are  using TFS, you can do this with the TFSConfig CodeIndex /reindexAll command. If you are working in Visual Studio Online, send an email request including your account name to us at and we will re-index your data.

By the way, if you rename your newly renamed project X back to A (perhaps you inadvertently changed the name and you want to go back to the original name) there is no problem. CodeLens will show the correct data.

As always, we are interested in hearing your comments on this feature. Try it out and let us know. You can send us feedback using Visual Studio’s Send a Smile feature. You can also log your feature suggestions on the Visual Studio User Voice site.