CodeLens not working VS 2019 Community (16.11.1)

Kenkoku Miyakawa 1 Reputation point
2021-09-22T16:46:06.973+00:00

My CodeLens doesn't work on any of my projects; references appeared on my colleague's VS when he was giving me a rundown of a project but when I open up the same one, nothing appears.

I have tried:

  • Disabling and enabling CodeLens
  • Disabling IntelliCode
  • Opening VS in safemode
  • ResetSkipPkgs
  • ResetSettings

and other solutions recommended on forums with the same issue. So far nothing has worked.

Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. PengGe-MSFT 3,381 Reputation points
    2021-09-23T03:12:26.013+00:00

    Hi, @Kenkoku Miyakawa

    Welcome to Microsoft Q&A!

    What is the type of your project? Have you tried Repair Visual Studio? Does CodeLens still not work after building the project, You can try to delete the obj folder of the project.
    *
    Update:

    Please try to delete the .vs folder of the project.
    Then:
    Go into Tools -> Options... -> Text Editor -> All Languages -> CodeLens.
    Uncheck "Enable CodeLens" option and click OK.
    Go back into Tools -> Options... -> Text Editor -> All Languages -> CodeLens.
    Check the "Enable CodeLens" option and click OK.

    Then open this project in Visual Studio.

    Sincerely,
    Peng
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    0 comments No comments

  2. Kenkoku Miyakawa 1 Reputation point
    2021-09-23T17:38:46.54+00:00

    Hi PengGe-MSFT

    I'm not too sure what the project type is but it's this project here: https://github.com/udotdevelopment/ATSPM

    I tried repairing as well as updating VS to the most recent version but it still doesn't work.

    Building the project as well as deleting the obj folders doesn't restore CodeLens either.


  3. Schirmer, Rick 0 Reputation points
    2024-01-18T15:49:52.5533333+00:00

    So, this is obviously old, but I just came across of it too. Eventually I figured out my cause and solution.

    My Solution was:
    Instead of opening the solution, I opened the folder of the solution. It does not show Code Lens when not in a VS Solution/Project. I had to explicitly open the .sln file. Then it worked.

    Maybe it helps someone else.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.