NuGet CLI reference.; 3 minutes to read Contributors. In this article. The NuGet Command Line Interface (CLI), nuget.exe, provides the full extent of NuGet functionality to install, create, publish, and manage packages without making any changes to project files. Installing NuGet packages directly from the command line. One feature I'd really like to see is the ability to scan a local repository, and update (the Nuget install command) all packages if there are newer packages available. Reply Delete. Installing NuGet packages directly from the comman.
I'm trying F# on OS X and I'm having trouble installing packages. My problem is to use MySQL. I have downloaded Nuget and I can launch it. However, I didn't find any useful documentation about how to use it on the command line. I managed to install MySQL.Data by doing mono nuget.exe install MySql.Data which downloaded it to my current repository. Is that normal? I was expecting it to be 'installed' in a more central directory.
![Install Nuget Packages Command Line For Mac Install Nuget Packages Command Line For Mac](/uploads/1/2/5/5/125510986/490966715.png)
Moreover, when I try to require it, r 'MySql.Data it doesn't work. It works if I set the include path properly by doing: fsharpi -lib:MySql.Data.6.8.3/lib/net45 But that seems super heavy. Is there a way to add all the installed nuget in the path automatically? The most common use I see is mono nuget.exe install mysql.data -OutputDirectory packages -ExcludeVersion Which would install in your project's directory (generally you ignore the packages directory in your repository however and just restore it with a script) and you'd then find it at packages/MySql.Data/lib/net45 Downloading nuget to your repository is also common.
You can always write your own script to do the the fsharpi hookups you want, nuget has a lot of convention, so it's possible to pick the right dll from lib/./ for your purposes And it's possible to do it with an fsharp script, here's an that can be executed directly, it downloads nuget, installs from nuget, and then executes another script (with fake not fsharpi, but that's totally possible. Short answer: No. Long answer: Yes, but it won't be what you hoped for. It is possible to get NuGet to put installed library some specific place.
![Command line in windows 7 Command line in windows 7](http://www.rstudio.com/images/docs/build_pane.png)
On Mac OS, add the following to the end of /.config/NuGet/NuGet.Config However, (a) NuGet still puts DLLs in different directories, so there is still no single place for fsharpi to find them. (b) Anyway fsharpi doesn't honor $MONOPATH, Mono's canonical way to add to the DLL search path. The closest I've come to a workable solution for fsharpi is:. Whenever you nuget a package, manually add it to MONOPATH (say, in /.profile).
E.g., supposing you told nuget to put stuff in /opt/nuget you would add: export MONOPATH=$MONOPATH:/opt/nuget/MySql.Data.6.8.3/lib/net45. Whenever you run fsharpi, explicitly feed it $MONOPATH: fsharpi -I:$MONOPATH If you feel adventurous you could then patch the fsharpi script to automatically include $MONOPATH. I find that this is not worth the effort. Simply constructing a script that starts fsharpi with the options you need for whatever you're currently working on is a much more practical solution. I'm an F# programmer on a Mac. My life is like an illicit love affair with someone married: I endure all the little slights because my heart leaves me no choice.
A feature I’ve long wished for in.NET Core and its command line interface (CLI) is the ability to manage nuget references from the command line. This becomes increasingly important as the final version of the tooling for.NET Core (and ) moves from a JSON-based project file to an XML-based one (for compatibility with the hundreds of other projects Visual Studio supports in that format).
Adding references to project.json wasn’t too bad, but it’s ever-so-slightly more painful to do in XML, and I’ve grown increasingly fond of using the dotnet CLI, especially when I’m working with Visual Studio Code (and sometimes on macOS). To check if you have the dotnet CLI installed correctly , run these commands in a new folder. Dotnet add package EntityFramework Alas, there’s no statement completion for the package name when you type it into the CLI. Sample output: Having access to the CLI makes it much easier to write setup scripts, or to quickly add common packages to projects where you know the package name and can type reasonably quickly.
If the command line isn’t your thing, don’t worry, you still have a bunch of other ways to work with packages, including editing the project file directly and using the GUI tools in VS2017 (or the built-in Package Manager Console there, and its PowerShell cmdlets). Filed Under: Tagged With:, About Steve Smith.