Search code examples
c#msbuildnugetcakebuild

Install Nuget Package from Network Drive with Cake


We have some nuget packages on a network drive that I'd like to be able to reference in my Cake script. The absolute path to the drive looks something like this:

\\MyDrive\NuGet\Packages\mypackage.nupkg

Is there any way to reference this package using preprocessor directives as explained here: http://cakebuild.net/docs/fundamentals/preprocessor-directives#tool-directive

If not, how would I go about doing it without preprocessor directives? Thanks.


Solution

  • The Cake pre-processor directive, in addition to the http protocol, also supports the file protocol. As a result, you can so something like the following

    #tool nuget:file://localhost/packages/?package=restsharp