0

I have a Visual Studio solution, containing multiple projects. To some of these projects, I had referenced a Shared Project, which has since been deleted. However, the Visual Studio project seems to still be referencing this deleted Shared Project.

A specific type I am using is present in both the Shared Project and a referenced NuGet package. Even though there is no sign of the Shared Project anywhere in the dependencies, I still get an ambiguous type error. Furthermore, when using Intellisense autocomplete in the project's .cs files, the Shared Project will be autocompleted. However, when I search through the entire solution by the Shared Project's namespace, there are no results. What's even more strange, is that the entire folder the Shared Project was in, has since been deleted. The files are literally not on my disk anymore.

I have tried deleting all bin and obj folders, as well as the .vs folder, but nothing changed.

D. Ondor
  • 79
  • 7
  • 2
    I'm not sure I understand, but did you remove the reference of the deleted project, as well as uninstall nugets? Can you add more details and concrete artifacts like names and screenshot of the reference list (is there warnings), because what you wrote is vague. –  Jun 17 '21 at 11:20
  • 1
    @OlivierRogier Yes, there is no more reference to the deleted project that I can find (not in the solution explorer under dependencies, not in the `.csproj` file, not in reference manager). Yet, Visual Studio is behaving as if the project is still referenced. – D. Ondor Jun 17 '21 at 11:23
  • Have you checked and cleaned the packages.config file, using the nuget UI manager or by hand? Can you add a screenshot top-slice of the solution explorer and indicate real names of artifacts that cause problems, as well as the installed nugets window, please? –  Jun 17 '21 at 11:23
  • Can you post exact message of VS about ambiguity of reference? – Quercus Jun 17 '21 at 11:27

1 Answers1

0

It seems this shared project is also referenced by a NuGet package I am using. In the latest version, this shared project is (obviously) deleted, but in the old version it is still present. This was the cause of my issue. I have updated the package and now everything is fine. Thanks for the input.

D. Ondor
  • 79
  • 7
  • I am glad to hear that your problem has been solved, you can click '✔' to mark your reply as an answer. It will also help others to solve the similar issue. – Jack J Jun Jun 21 '21 at 07:38