Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.


You use Visual Studio Ultimate 2013 RTM to connect to Team Foundation Server (TFS) 2013 Update 4. Assume that you open a Visual C# or Visual Basic file that is previously renamed in the following ways:

  • Only the case of the file name is changed, for example, Filename.cs versus filename.cs.

  • The file is renamed in the last 12 months. This is the default time period for indexing change history. See CodeIndex Command (indexHistoryPeriod setting).

In this situation, you receive a StackOverflowException exception that occurs in Microsoft.TeamFoundation.CodeSense.Server.WebAPI.CodeLensFileSummariesControllerBase.ReadFileSummaries, and then a crash happens in IIS worker process "w3wp" of TFS.

Note This crash affects all current operations on TFS. However, the "w3wp" IIS worker process will restart automatically, and all other operations will run correctly if it restarts. If you try to reconnect Visual Studio Ultimate RTM to TFS, this causes another StackOverflowException exception and a crash.


This issue happens because, when you open the code file in Visual Studio, Visual Studio asks TFS for CodeLens information. The CodeLens component in TFS causes a StackOverflowException exception, and then causes the crash of IIS worker process "w3wp" in TFS, not Visual Studio.


To resolve this issue, apply Visual Studio 2013 Update 2 or a later update from the Visual Studio downloads.
You can also upgrade TFS with Team Foundation Server 2013 Update 5 or Team Foundation Server 2015 RTM. It is available from Visual Studio downloads.


To work around this issue, turn off CodeLens in Visual Studio Ultimate 2013 RTM. Go to Tools > Options > Text Editor > All Languages > CodeLens.

Note If the options in the Resolution and Workaround sections do not work, you can turn off CodeLens in TFS by using the CodeIndex command with the TFSConfig command. This is the least preferred option.

More Information

To help us make CodeLens better for you, send feedback or request features at Visual Studio UserVoice, or ask questions in the MSDN forums.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!