Want your own NuGet repo? Don’t want to pay for MyGet or similar?
Here’s how I’ve done it recently at Mailcloud (over an espresso that didn’t even have time to get cold – it’s that easy)
Setting up a NuGet Server
Creating your own nuget server could barely be any easier than it is now.
Open Visual Studio -> New Project -> WebSite
Empty Website
Open Package Manager/Console -> Install-Package Nuget.Server
It’ll look something like this afterwards:
Add API key to appsettings
For the API key: I just grabbed mine from newguid.com:
Publish site
If you’re using Azure and you selected the “Create remote resources” back at the start when creating the project, you can just push this straight out to the newly created website with a right click on the project -> publish :
Or use powershell, or msbuild to webdeploy, or ftp it somewhere, or keep it local – your call, buddy!
And that’s the hard part done 🙂
Using it
First visit
If you haven’t configured an API key then the first visit page will alert you to this.
Push a package
This is done in the usual manner – don’t forget your API key:
Check the repo
Let’s reference our shiny new nuget repo:
Add a new source
Edit your Package Manager settings and add in a new source, using your new repo:
Find your packages!
Now you can open Package Manager window or console and find your pushed nuget package: