0

In Visual Studio Code, i would like to keep a local copy of a referenced Nuget package in the project folder for the case the package will not be available online for some reason in the future.

nuget restore shall still be able to download it from the internet if the local copy is not yet there.

I think thats exactly the behaviour with Visual Studio, but i can't get this running with Visual Studio Code

gerthmar
  • 36
  • 4
  • 1
    Have a look into ["local nuget feed"](https://learn.microsoft.com/en-us/nuget/hosting-packages/local-feeds). – Fildor Nov 05 '20 at 15:26

1 Answers1

0

I think i found a solution myself.

Adding a file called nuget.config with the following content to the project folder does exactly what I wanted. The packages are now put into the local packages folder.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
    <add key="globalPackagesFolder" value="packages" />
    <add key="repositoryPath" value="packages" />
</config>
</configuration>
gerthmar
  • 36
  • 4