Getting Sytem.IO.DirectoryNotFoundException when trying to install Microsoft.Extensions.DependencyInjection

14 views Asked by At

System.IO.DirectoryNotFoundException: Could not find a part of the path \packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.0\buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets

enter image description here

1

There are 1 answers

0
Trincity On

I posted this question to the Microsoft Forum and they responded to me with a few answers: https://learn.microsoft.com/en-us/answers/questions/1608823/visual-studios-22-nuget-package-manager-i-get-a-sy

  1. The file path is too long.
  2. There was an issue with downloading the package. Since you are targeting NET 4.6 it looks like then check your packages folder to confirm it was downloaded. If not then restore the packages again.
  3. That your upgrading and there is a conflict between the old and new packages. Close VS, wipe the packages folder and open VS back up and restore the packages again. Then try upgrading.

The first answer worked for me. I recloned to a shorter path and the installation worked.