.netvisual-studio.net-corenuget-package-restoredotnet-restore

Project x was not imported due to file not existing (path length issue)


I am currently facing the error (see screenshot) where I can not add dependencies anymore on my Visual Studio solution. Would this have to do with path issues, or is something else going on.

I already tried nuget restore, cleaning the solution etc...

The reason the filenames are so long is because of clarity where they belong to, but if this is a limitation (which I expect, but can't find it) then how do I best go to work?

Error in VS2019


Solution

  • OS also has a MAX_PATH limitation. This limitation is 260 characters. Even if your file path is below this character limit, you may experience issues due to reserved space. post

    I recommend creating a simple and short hierarchy and naming. You will have a lot of trouble naming this way.

    If you want to continue naming this, make the following settings in your operating system and reopen and test your project:

    First,

    Second, (if In Windows 10 Pro or Enterprise)

    Restart the computer.

    Once your computer restarts and you open your project, the problem should be resolved.

    If there is still a yellow warning next to NuGet packages, confirm it by typing dotnet restore in Nuget Packet Manager. (Make sure you choose the default project correctly). Restart Visual Studio if needed.