Enable CodeLens in Visual Studio 2019

Picture: Microsoft

Enable CodeLens in Visual Studio 2019

At the moment it happens to me more often that CodeLens is not active in Visual Studio. Unfortunately I couldn't find out if this is in bug in the current preview version or if a Visual Studio extension is responsible for it.

You can activate the CodeLens easily via the Visual Studio options.


Simply open the modal option window under Tools -> Options, search for CodeLens and activate the desired features accordingly.

What's CodeLens?

CodeLens is one of my favorite features in Visual Studio.

Above every important line of code like methods, classes or properties, Visual Studio inserts a line with helpful links:

  • Latest Tests
  • References used
  • Last author

You can read more about CodeLens here: https://docs.microsoft.com/en-us/visualstudio/ide/find-code-changes-and-other-history-with-codelens