Visual Studios 22 Nuget Package Manager: I get a System.IO.DirectoryNoFoundException Error when installing Microsoft.Extensions.DependencyInjection

Anonymous
2024-03-05T15:24:56.6233333+00:00

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

Shouldn't the installer take care of creating the targets of the dependencies for the package?

User's image

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

Answer accepted by question author
  1. Michael Taylor 61,076 Reputation points
    2024-03-05T19:31:14.7566667+00:00

    Yes it will. That isn't the issue here I believe. One thought that comes to mind is that your project is in a long directory and adding all this extra pathing is causing it to exceed the max path size.

    Another thought is that 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.

    Yet another thought is 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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.