[SOLVED] Can't update 4 NuGet packages due to error "Could not find a part of the path…"

Issue

I can’t update any/all of the following packages in my solution:

enter image description here

I get the error:

enter image description here

I’ve tried reinstalling all packages via NuGet console but still get the same error.

I’m using VS 2022 64bit v 17.0.4. Migrating to PackageReference isn’t allowed on this solution.

Solution

The only workaround for us was to clone the solution from the remote repository to a fresh local directory.

We tried emptying the NuGet cache, but without success. The problem is that the .dll-File was not present in the package directory (see file path from OP). Mixed backward and forward slashes are not a problem. Deleting/restoring packages did not solve the issue. Commands like Get-Package didn’t work either.

We tried diffing the two folders, a) the freshly cloned working one and b) the old not working one, as we suspected that config files not under version control caused the issue. But without any success. We couldn’t find any relevant difference. The binary .suo-File was not considered by us. Deleting the .suo-File and restoring packages didn’t solve the issue either.

We gave up on that point because we have a workaround to deal with this issue.
I would dig for global VS/NuGet cache/setting files but we decided to not invest more time on that.

Answered By – Yannic Hamann

Answer Checked By – Pedro (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *