0

I have a local NuGet Feed that I want to use with Cake

I tried that using:

#tool "nuget:file://masterserver/publish/?package=restsharp" (filesystem folder) <br>

But got this error: Unable to find package 'restsharp' ????

and this:

#addin "nuget:http://masterserver/NuGetWebHost/Nuget/ (NuGetServer on IIS) <br>

But got this error: ....build.cake:4: Query string parameter 'package' is missing in package reference.

How can I access my Local NuGets ?
Cant restore via my local feed?

ndm
  • 59,784
  • 9
  • 71
  • 110
CShape
  • 11
  • 4
  • Can you try a combination of the above: `#addin nugget:http://masterserver/NuGetWebHost/Nuget?package=restsharp` You can check the docs for the addin directives [here](https://cakebuild.net/docs/fundamentals/preprocessor-directives) – agc93 Sep 20 '17 at 03:10
  • **I get this error :** Running build script... An error occurred while retrieving package metadata for 'restsharp' from source 'http://masterserver/NuGetWebHost/Nuget/ '. The V2 feed at 'http://masterserver/NuGetWebHost/Nuget/FindPackagesById()?id='restsharp'' returned an unexpected statu s code '500 Internal Server Error'. NuGet exited with 1 Error: Value cannot be null. Parameter name: path – CShape Sep 20 '17 at 05:18
  • Okay so that means Cake is reaching your NuGet server and it's getting a 500 error response. Are you sure your internal feed URL is just `/NuGetWebHost/Nuget`? Can you verify that that *exact* feed URL works in Visual Studio, for example? – agc93 Sep 20 '17 at 05:32
  • Yes I can use my nuget feed from VS2017 from a laptop. The buildserver, where the Cake script is running, is the same server as the nuget server is hosted on. – CShape Sep 20 '17 at 11:06
  • **I can now get Cake to connect to my NuGet server. But now I get the following errors. Any ideas?** `C:\Program Files\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : The feed 'MASTERSERVER [http://masterserver/NuGetWebHost/nuget]' lists package 'Interface.1.0.0.82' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.` – CShape Sep 21 '17 at 20:07
  • Which version of Cake are you using? What kind of NuGet server are you running? If you're using latest version of Cake (0.22.2 at this moment) do you get the same error if you opt-in to the new in-process nuget handling, read more about it here: https://cakebuild.net/blog/2017/09/cake-v0.22.0-released – devlead Sep 25 '17 at 07:59

0 Answers0