Skip to content

Instantly share code, notes, and snippets.

@xt0rted
Last active September 11, 2022 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xt0rted/1c311c3a38e7d7b2bb6ae2c06be4403f to your computer and use it in GitHub Desktop.
Save xt0rted/1c311c3a38e7d7b2bb6ae2c06be4403f to your computer and use it in GitHub Desktop.
Local NuGet package source

Local NuGet package source

With these config settings you can create a .nuget folder in the root of your project and install packages without using a nuget server. This could be expanded on using newer features in NuGet v6 to map individual packages to a source to guaranteee you don't accidentally install one from a remote server.

.gitignore

# Using this as the starting point https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# Add this at the end
!.nuget/*.nupkg

nuget.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="local" value=".nuget" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment