Don't get me wrong, I just *LOVE* CodeLens, but I've found a few times where I want to control it's server jobs.
A few scenario's where I don't need CodeLens running for my Project:
- The project is an archive and isn't actively used
- None of the developers on the team have an MSDN Ultimate license
- You're upgrading a massive TFS server and want to control which Project Collections are processed first.
I didn't actually know that there was an option to control Code Lens indexing until today, thanks to Mathew Aniyan.
To activate or deactivate the indexing at a Project Collection Level, you can use the TFSConfig CodeIndex command, as outlined here. You can get finer granularity by adding Ignore paths to the list.
To turn off for the whole collection use:
tfsConfig codeindex /collectionName:DefaultCollection /setIndexing:off
To turn off for a specific team project use:
tfsConfig codeindex /collectionName:DefaultCollection /ignoreList:add $/ProjectName/*
This will allow you to reduce the amount of processing required after an upgrade by excluding old data and it can improve the performance a little should you have a TFS server which has been sized tightly.
Even though "tfsconfig codeindex /?" doesn't really explain this, one can use a wildcard at the start or end of the path:
Adding to or removing from the ignore list requires a valid path to be specified.
Wildcards ('*') are allowed as the first and/or last characters of the path.