Migration of .NET Framework packages.config to PackageReferences removed most References and shows warnings and errors

1.2k Views Asked by At

I have a legacy .NET Framework solution (ASP.NET) which I am trying to slowly fix the technical debt for. I tried to move the packages.config to PackageReferences in 4 of the 5 projects in the solution (the non-ASP.NET ones). One of the projects, an old SpecFlow unit testing project, was "migrated" to the new format, however its References were mostly deleted and my project was unable to find all of the new packages even though the PackageReferences are now correctly referenced in the csproj file rather than the removed packages.config file.

All I did was that I changed the Tools->Options->NuGet Package Manager option to PackageReference, and then context-clicked the project to select the Migrate to PackageReference item. I also selected all of the Transitory(?) Packages in the list that it gave me. Then I let Visual Studio run its process. I am using Visual Studio 2019 but this solution was made with older software and versions (it did run in both VS 2017 and 2019 before this process).

I do see the NuGet packages when I am looking for them in the NuGet Package explorer window and looking at the installed window. At least I saw some of them (I did not do an exhaustive look as there are dozens of them).

  1. What is the cause of the References being deleted but not repopulating like my other projects?
  2. Is there an easy way to restore my references or do I have to add them back in one at a time?
  3. In the Add Reference popup, I cannot find my NuGet packages or what I could reference before. Where should they be located? I am missing everything from System and Microsoft packages to third party and our own third party packages?
0

There are 0 best solutions below