In my case, I navigated the project folders and the location of the vs solution file (.sln). As soon as I finished adding projects again, there was a package folder at the solution level, and one remained in the project subfolder. Thus, in this project, the links to the folders of the corresponding packages in the .csproj file are corrupted.
Reinstalling or other tips regarding the nuget package manager in this thread have been helpful. I noticed that after I reinstalled several packages, in my diff source code from git the path to the packages folder was changed in the csproj file.
Before
<HintPath>packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
After
After
<HintPath>..\packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
So, if you are working with the same problem and you have many nuget packages, it may be easier to close the whole solution, open the csproj file in a text editor such as vscode, and fix relative links using search and replace. Then just save, close, reopen the solution in VS and restore the nuget packages. This should do the trick. (In any case, you must delete the local package folder at the project level so that the project really fails if it does not receive the necessary packages.)
AIsmaili Aug 27 '19 at 18:12 2019-08-27 18:12
source share