-1

I'm trying to install some Package on Visual Studio 2017 using NuGet, I need the Microsoft.EntityFrameworkCore package but when I try to install, it fails because of a long path/repertory name. This path is supposed to be shorter than 260 chars (or 248 if it's a repertory name), but I can't figure out which path/repertory they're talking about (there is no more info in the error). So I did look to my C# project Path and this one is only 130 chars.

Do you have any solution ? I'm on a school project and I really need these packages , hope you guys can help me.

  • it is tracked [here](https://github.com/NuGet/Home/issues/3324). Put the project in a short path (C:\projects\FooProj) – magicandre1981 Dec 06 '18 at 15:31
  • Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu Dec 13 '18 at 02:02

1 Answers1

0

Nuget install faill because of a path which is to long

When we install the nuget package via NuGet to our project, NuGet will download the package from the nuget source and save it in the local cache.

For .net framework project, NuGet will save the package in the \packages folder in the solution folder by default. In this case, if we have the long file name issue, we could move the solution to the root of C disk, just like magicandre1981 said.

Besides, if you are interested in nuget, we could overwrite the repositoryPath value in the nuget.config file to change the default path of \packages folder.

Check details from this thread and the document.

For .net core/standard project, NuGet will save the package in the global folder C:\Users\<UserName>\.nuget\packages. In this case, if we have long username, we may get this issue, to resolve it, we could rename our username or we could change the default global package folder.

Check this thread for details.

Hope this helps.

Community
  • 1
  • 1
Leo Liu
  • 71,098
  • 10
  • 114
  • 135