Question

I try to run the following nuget command , in the "D:\work\Development\" directory there is solution file

nuget.exe restore D:\work\Development\

I received an error

Could not find a part of the path C:\work\Development

When I copy the nuget.exe file to the directory D:\work\Development and run resotre like so

nuget.exe restore

from there it works

How can I make restore work from another directory than the one my solution is in?

Was it helpful?

Solution

What I ended up doing is using restore from with a relative path like so :

nuget.exe restore ..\

OTHER TIPS

You should pass in the path to the .sln file, such as D:\work\Development\mysolution.sln or path to the packages.config file.

Please refer to this doc for how to use the nuget.exe restore command.

http://docs.nuget.org/docs/reference/command-line-reference#Restore_command

I had a similar issue getting a relative path to work, but in my case I was accessing the nuget.exe in a subfolder as well as trying to restore packages in another folder.

I realised that the restore command path is based on the directory you are running the command from, not the directory the nuget.exe file is in.

eg. If your nuget.exe file is in a Projects\.nuget subfolder, and you are in the root directory (one up from Projects), running this will restore any packages for a solution that is in the Projects subfolder.

  Projects\.nuget\nuget.exe restore Projects 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top