Visual Studio 2019 – All references say referenced component could not be found

Problem

When I open a C# project in Visual Studio 2019, none of the references are loading. In the error list it says:

The referenced component could not be found

image.png

This usually means you need to restore the Nuget Package. In this case, it’s even showing this for .NET Framework references – such as System.Core.

Solution

I opened the .csproj file and saw an invalid imported project. This will be specific to your project, but for me the invalid imported project is NUnit3TestAdapter. To fix my problem, I had to manually remove references to this from the .csproj file.

  1. Open the .csproj file in Notepad
  2. Delete the invalid Import Project section
  3. Delete the invalid Target section
  4. Save the changes

2 thoughts on “Visual Studio 2019 – All references say referenced component could not be found”

    • 1. In Visual Studio right-click on your project
      2. Click Open Folder in File Explorer
      3. This will open the folder. In there, you’ll see the .csproj file
      4. Right-click on the .csproj file and Open With > Notepad (or Edit with Notepad++ if you have that installed)

      Reply

Leave a Comment