Visual Studio CodeLens: Missing References? Here's How to Fix It

Steven Jul 09, 2026

Are you facing issues with Visual Studio CodeLens not showing references? You're not alone. This is a common problem that can be quite frustrating, especially when you're trying to understand the context of your code. Let's delve into this issue and explore some potential solutions.

Visual studio extensions
Visual studio extensions

Before we dive into troubleshooting, let's ensure we're on the same page. Visual Studio CodeLens is a feature that displays inline information about your code, such as references, implementations, and more. It's designed to help you understand your codebase better and improve your productivity. Now, let's get back to the problem at hand.

the visual studio code is shown in this screenshote screen shot, with text below it
the visual studio code is shown in this screenshote screen shot, with text below it

Understanding the Issue

When Visual Studio CodeLens isn't showing references, it could be due to a variety of reasons. It might be a temporary glitch, or it could be a more persistent issue caused by extensions, settings, or even your code itself.

Start Coding in Your Browser With Microsoft Visual Studio Online
Start Coding in Your Browser With Microsoft Visual Studio Online

In this article, we'll explore some common causes and provide solutions that you can try. Remember, every situation is unique, so it might take a bit of trial and error to find the fix that works for you.

Checking Your Extensions

Exploring the New Profiles Templates in Visual Studio Code
Exploring the New Profiles Templates in Visual Studio Code

Extensions can sometimes interfere with Visual Studio's built-in features. If you've recently installed or updated any extensions, they might be causing the issue. To check this:

  1. Open Visual Studio and go to the Extensions view (Ctrl + Shift + X).
  2. Click on the 'Installed' tab to see your installed extensions.
  3. Disable each extension one by one to see if that resolves the issue.

Verifying Your Settings

an image of a computer screen with some text on it
an image of a computer screen with some text on it

Your Visual Studio settings could also be causing the problem. Let's check your settings to ensure they're configured correctly:

  1. Open Visual Studio and go to File > Preferences (Ctrl + ,).
  2. Navigate to 'Text Editor' > 'Code Lens'.
  3. Ensure that 'Enable Code Lens' is checked. If it is, try unchecking and rechecking it to see if that helps.

Checking Your Code

an image of a computer screen with some text on it and two other screens showing the same
an image of a computer screen with some text on it and two other screens showing the same

Sometimes, the issue might not be with Visual Studio itself, but with your code. Certain syntax errors or code structures can prevent CodeLens from working correctly.

To check this, try opening a new, clean project in Visual Studio. If CodeLens works in the new project but not in your original one, the issue is likely with your code. You can then start debugging your code by commenting out sections and seeing if that resolves the issue.

Recover Unsaved Visual Studio Code Files: Simple Ways
Recover Unsaved Visual Studio Code Files: Simple Ways
How to run C# in Visual Studio Code
How to run C# in Visual Studio Code
Visual Studio Code setup—Part 1
Visual Studio Code setup—Part 1
Visual Studio vs Visual Studio Code: What's Different?
Visual Studio vs Visual Studio Code: What's Different?
6 Visual Studio Code Extensions I Cannot Live Without
6 Visual Studio Code Extensions I Cannot Live Without
Visual Studio IntelliSense Not Working? Multiple Ways for You! - MiniTool
Visual Studio IntelliSense Not Working? Multiple Ways for You! - MiniTool
Visual Studio Code Tutorial for Beginners - Introduction
Visual Studio Code Tutorial for Beginners - Introduction
8 Visual Studio Code Extensions You Didn’t Know You Needed
8 Visual Studio Code Extensions You Didn’t Know You Needed
VS Code: Getting Started, literally
VS Code: Getting Started, literally
a woman is standing in the middle of a round building with her legs crossed and feet up
a woman is standing in the middle of a round building with her legs crossed and feet up
Shadow Perspective
Shadow Perspective
the ultimate guide to how to run claude code for free on windows and mac
the ultimate guide to how to run claude code for free on windows and mac
Only Visual Studio Code is Perfect for You
Only Visual Studio Code is Perfect for You
how to create simple desktop apps in visual studio
how to create simple desktop apps in visual studio
the settings menu in windows 10 with options to select which features are available for each user
the settings menu in windows 10 with options to select which features are available for each user
User and workspace settings
User and workspace settings
How to Fix Visual Studio Code Crashing on Windows 11
How to Fix Visual Studio Code Crashing on Windows 11
Ready to Code Python in Visual Studio? Let’s Set It Up
Ready to Code Python in Visual Studio? Let’s Set It Up
an error screen for the error lens app
an error screen for the error lens app
How to Install Visual Studio Code on Windows Step by Step
How to Install Visual Studio Code on Windows Step by Step

Ensuring You're Using the Latest Version

Outdated versions of Visual Studio can sometimes cause issues with features like CodeLens. Always ensure you're using the latest version of Visual Studio to avoid such problems.

To check for updates, open Visual Studio and go to Help > Check for Updates. If there's an update available, install it and see if that resolves the issue.

Reinstalling Visual Studio

If all else fails, you might need to reinstall Visual Studio. This can sometimes fix persistent issues that can't be resolved any other way.

Before you proceed, make sure to backup your projects and settings. You can do this by going to File > Export > General and selecting 'Settings'.

If none of the above solutions work, it might be a good idea to reach out to the Visual Studio community or Microsoft's support for further assistance.

Remember, the key to troubleshooting is patience and persistence. Don't give up if the first solution doesn't work. Keep trying until you find the one that does. Happy coding!