Nuget install faill because of a path which is to long - visual-studio-2017

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.

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.

Related

Visual Studio 2017 Nuget Install Package Builds Project Instead of Installing / Uninstalling Packages

When importing existing library projects into an existing solution (after I copied them locally from somewhere else), when I try to install or uninstall a Nuget package through the package manager, it justs builds my solution showing me all of the errors I have because the package is not installed. It does nto try to install or uninstall the package. Why is it building my project instead of just installing / uninstalling the bloody package?
Why is it building my project instead of just installing /
uninstalling the bloody package?
It's not default behavior of VS IDE itself.
As for VS2017, if we install a normal package using Package Manager UI, VS will check the compatibility between the package to consume and the current project. If they're compatible, the package will be installed successfully, if not, VS will throw nuget error like NU1202 or others in ErrorList window.
But I'm sure for VS2017, installing/uninstalling won't call a build.
Possible causes of the issue and corresponding suggestions:
1.This behavior results from one third-party extension.
Reset all VS settings => disable all the third-party extensions => restart VS to check if the issue persists. If after the check you find this issue results from one extension, you need to make sure if the extension provides one option to turn on/off the auto-build. Or you may need to disable/uninstall the extension temporarily and contact the author of the extension to post the issue.
You may get more details for trouble-shooting from this similar issue.
2.Custom script(.ps1,.targets) from one specific nuget package causes this.
The authors can place powershell script and PackageID.targets in .nupkg when generating packages. Some of these scrips will execute when we install the package, others will execute when we uninstall the package. See similar issue here.
You can create a new simple console project TestProject in TestProject solution. Then right-click solution=>add=>Existing project to import a new external project. Now let's install the Newtonsoft.Json package to check if the issue disappears. If the issue disappears in new project with Newtonsoft.Json package. I think it indicates one special package you try to install/uninstall may cause the issue.
Hope all above helps and feel free to let me know if there's any update.

Illegal characters in path when NuGet tries to remove old package from packages folder

Suddenly I'm getting an error when trying to update NuGet packages (or doing anything with NuGet packages). The error says it has something to do with the path but the path has not changed. Does anyone recognize this?
I'm using Visual Studio Enterprise 2017 version 15.8.5
Below is a copy of the output from Package Manager. The update was triggered manually from the "Manage NuGet Packages for Solution..." dialog.
It looks like the new version of the package is successfully installed. The problem occurs when the old package is to be removed from the packages folder.
Found package 'GenericParser 1.1.6' in 'C:\vsts\FLOTT\Main\packages'.
Removed package 'GenericParser 1.1.5' from 'packages.config'
Successfully uninstalled 'GenericParser 1.1.5' from Flott.App
Package 'GenericParser.1.1.6' already exists in folder 'C:\vsts\FLOTT\Main\packages'
Added package 'GenericParser.1.1.6' to 'packages.config'
Successfully installed 'GenericParser 1.1.6' to Flott.App
Removing package 'GenericParser 1.1.5' from folder 'C:\vsts\FLOTT\Main\packages'
Illegal characters in path.
System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetFileName(String path)
at Microsoft.TeamFoundation.Common.FileSpec.GetFullPath(String path, Boolean checkForIllegalDollar)
at Microsoft.TeamFoundation.VersionControl.Client.Client.GetLocalWorkspace(String localPath, Boolean throwIfNotFound)

VSO Package Library - Nuget Delayed

Our team has a private Package Feed set up in Visual Studio Online. We can push the latest version of a library we are working on to the feed, and then see it in our NuGet package manager in VS2017.
In the last few weeks, this process has become unreliable, and we cannot determine why.
Steps:
A developer builds nuget a package locally.
We push the package to our feed using the command line
nuget.exe push -Source "VSO-Feed" -ApiKey VSTS ..\Project\bin\Debug\Project.0.1.1-alpha.nupkg
Command returns success
We can see new new package version under "Packages" in VSO
NuGet Package Manager in VS 2017 cannot find the new package
Attempts to update the .csproj file manually to reference the new version sometimes succeed, but just as frequently the project build fails with a message like
Unable to find package Project with version (>= 0.1.1-alpha)
Found 243 version(s) in vso-feed [ Nearest version: 0.1.0-alpha ]
After an indeterminate period of time, usually at least 45 minutes, it suddenly works again!
Has anyone else experienced this? Our searches have come up empty.

Nuget doesn't seem to be installing header files

I'm new to the Nuget package manager (Maven guy normally, trying to fix a project my boss set up). Our project requires boost and openssl. Currently someone has to have boost and openssl installed on their system. I am hoping to use nuget to install the dependencies so that we can just clone-and-build anywhere that has VS2015.
But I can't make it work. Even installing the Boost headers and boost-vc140 packages, my project is still reporting Cannot open include file: 'boost/noncopyable.hpp': No such file or directory with the include #include <boost/noncopyable.hpp>.
I've tried upgrading to the newest version of nuget (the previous one ships with VS2015), I've installed all the boost nuget libraries, and just generally beat my head against this for the last day. This seems way more difficult than it should be to add dependencies to a project.
I also have no idea what openssl project to select.
Can someone please let me know what I'm doing wrong?

32feet: could not install with nuget

I'm trying to install this library in an existing c++ project with NuGet, but the installation stops and give me the following message:
Could not install package '32feet.NET 3.5.0.0'. You are trying to install this package into a project that targets 'Native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
What does this mean?
Looks like NuGet currently doesn't support that:
http://nuget.codeplex.com/workitem/3665
https://nuget.codeplex.com/workitem/3530