Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using paket offline

Is it possible to use paket having no connection to Nuget repository? We have our nuget repository where we store all necessary libs. We use paket to fetch it. Everything works fine while we are working under our company network or using vpn. However paket fails to reach our nuget repository outside our network. No doubts, this behavior is expected.

At the same time I noticed that paket tries to fetch packages from local nuget cache (%userprofile%.nuget) first. The desired behavior is to work directly with nuget local cache if there is no connection to original nuget repository and to throw just warning about it, not an error (throw an error only if there is no required package in cache). Is it possible or such functionality is not provided (yet)? As I know Nuget doesn't crash build if it can get packages from the local cache without connection to repository. Thanks

UPD Howto disable nuget machine-wide cache? - that is not what I want. Nuget itself works fine, the question is about paket.exe

like image 537
Ihar Bandarenka Avatar asked Jun 21 '26 15:06

Ihar Bandarenka


1 Answers

NuGet cache is folder mostly located in Users\{CurrentUser}\Local\NuGet\Cache and stores data from network searches and downloaded packages before they're copied into your packages folder.

What you're probably looking for is local repository, e.g. any folder available in your filesystem. You can even combine it with network repositories and so it will work both online and offline.

paket.dependencies content:

source C:\MyLocalFeed
source \\my.domain\networkFolderFeed
source source https://nuget.org/api/v2 

There are no further requirements on structure of folder you're going to use as repository. Only thing you need is to place there your *.nupkg files.

like image 97
Jaroslav Kadlec Avatar answered Jun 24 '26 07:06

Jaroslav Kadlec