Reading Using NuGet without committing packages to source control I've understood I should add the .nuget
folder to my project to enable package restore during build... and reading Prepare a git repo for NuGet I've understood I could remove NuGet.exe
and NuGet.config
and let the IDE download them automatically by setting DownloadNuGetExe
to true
in NuGet.targets
.
Well, I'm a bit confused since 1) Xamarin Studio does not download neither NuGet.exe
nor NuGet.config
... and 2) the .nuget
folder is not necessary at all since one could just issue command Restore NuGet Packages on the solution explorer and the packages are restored anyway.
Having said that, what's the right way to configure package restore on Xamarin Studio/MonoDevelop?
Or you can use the new package restore in 2.7. Just run
nuget.exe restore <your_solution_file>
to restore all packages used by the projects in the solution.
See http://docs.nuget.org/docs/reference/package-restore for details.
Enabling package restore so it happens when the project is compiled is not possible using the NuGet addin for Xamarin Studio. It is something that I did not implement. If you want to do this you will have to add the files manually and edit the project to use the NuGet.targets file.
Personally I would instead use the Restore NuGet Packages menu option and not use the NuGet.targets file. One thing you lose here is triggering a package restore on every build however you only need to do it once. You also get some benefits of using this approach:
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