Microsoft Visual Studio 2022 Object Reference Not set to an instance of an object

Weiyan Lu 26 Reputation points
2021-12-06T04:52:56.427+00:00

Hello,

Recently, I updated my vs to the latest version. But I cannot checkout or change to other branch. Vs always throw below error message.

I've tried to remove the following folders and restart my vs:
C:\Users\%userprofile%\AppData\Local\Microsoft\VisualStudio
C:\Users\%userprofile%\AppData\Local\Microsoft\VSCommon

Before vs2022, I used vs2019. But no such error.

Could you please help me to fix this issue. It bothers me so much.

155126-image.png

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,306 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
1,012 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 30,386 Reputation points Microsoft Vendor
    2021-12-06T09:43:58.91+00:00

    Hi @Weiyan Lu ,

    Welcome to Microsoft Q&A!

    Can you tell me the detailed version of your VS2022? The latest version of VS2022 is version 17.0.2.

    You can remove the hidden .vs folder in the project folder and re-launch your Visual Studio to check if the error disappears or not.

    I suspect your Visual Studio is corrupted. If possible, you can try to uninstall it and install it again.

    Sincerely,
    Anna

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      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.
    1 person found this answer helpful.

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.