SOLVED: Error installing Nuget Package "Could not find a part of the path "...Microsoft.Extensions.DependencyInjection.Abstractions.targets"

When you try and install Microsoft.Extensions.DependencyInjection.Abstractions package (or something that depends on it such as Microsoft.SqlServer.SqlManagementObjects you may see the following error:

Could not find a part of the path 'path\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.2\buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets'.

This error can occur if the path is too long.

A quick fix is to move the entire project folder higher up to the root path of the drive, install the packages and then move it back to the previous location.

Comments

Popular posts from this blog

SOLVED: Exchange Online Management PowerShell Connect-ExchangeOnline bug "A window handle must be configured. See https://aka.ms/msal-net-wam#parent-window-handles"

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

get-windowsfeature : The given key was not present in the dictionary