When trying to install the NuGet Package RestSharp I get the error The path is not of a legal form
and the package is not installed.
When installing from the console using Install-Package RestSharp
, there are a lot of the following messages:
The item C:\Users\myName\Source\Workspaces\Project\Solution\packages\RestSharp.105.1.0\lib\net35\RestSharp.dll could not be found in your workspace, or you do not have permission to access it.
This happens with the newly released Visual Studio 2015 (community edition).
Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.
Restore packages manually using Visual StudioEnable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.
Edit: If you have NuGet 3.0, then that's the problem. Just update NuGet and everything should work. The steps below apply to NuGet 3.0, which are painful and error prone. Don't go through such pain, choose the easy step, update your Nuget!
I updated to VS Express 2015 and since then i've been through some adventures.
TL;DR if you "disable" TFS (source control), you should be able to install the package. Then add the solution to source control again, but it caused me tons of problems.
So...
I see you have TFS. I have it too.
Also, I see you are getting the same error messages as me.
I tried to install LanguageExt (an awesome library for C# 6) and it failed when it tried to install one of its dependencies (System.Collections.Immutable).
If you want to go through all this things, please make a backup of your project folder.
This is what I did:
1 - Copied my solution folder to somewhere else.
2 - Opened the solution. VS smartly asked me to add it to source control, but I didn't want to.
3 - Tried to Install-Package LanguageExt
4 - Unexpected success!
5 - "Fine, let me just add it to the TFS source control again"
Here my journey started.
Since I have little experience with TFS, I got thousands and thousands of conflicts, files vanishing and appearing again, etc.
But after some work, I got it running.
And it was worth it.
But the solution isn't large, so, it was easy.
Had the same problem with the packages below, updated NuGet via "Tools -> Extensions and Updates -> Updates" to v.3.1.1.0 and now everything works again. Thanks!
Microsoft.Bcl
Google.Apis.Calendar.v3
RazorEngine
Sample error so more people can find this thread:
"Install-Package : The path is not of a legal form. At line:1 char:16 + Install-Package <<<< RazorEngine + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With