Setup a private Nuget server, host your own Nuget feed

Before I start talking about how to create a private Nuget server, I need to show you how do you create a Nuget package by yourself.

To create a Nuget package, you can either use Nuget.exe command line tool to do it, or use Nuget Package Explorer. Nuget Package Explorer provides the nice neat interface to allow you create a nuget package without any knowledge of command-lines syntax. To download them both, from

http://nuget.codeplex.com/releases/view/58939 (Nuget.exe)

http://nuget.codeplex.com/releases/view/59864 (Nuget Package Explorer)

After you have created your own packages, you can now setup the private Nuget feed.

1. Create a web application in Visual Studio. I am using MVC as my Nuget server application.

2. Install “NuGet.Server” package from “Package Manager Console”.

3. Configure the package folders and ApiKey

  <appSettings>
    <add key="webpages:Version" value="1.0.0.0" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="apiKey" value="1234" />
    <add key="packagesPath" value="C:\MyLocalNugetFeed" />
  </appSettings>

4. Deploy your application to IIS. And you server is running.

To view the feed and download packages.

Right click “Reference” folder of your project, Click “Manage Nuget Packages”.

image

Then add “http://youdomain.com/nuget” as your feed address.

Adding new feed to package sources

You will be able to see your feeds in the list.

To publish a package

You can use Nuget Package Explorer or Nuget.exe.

Nuget.exe

image

Nuget Package Explorer, enter your publish Url and ApiKey then click Publish.

image

What are you waiting for to get your own Nuget feed and share code snippets or libraries with your mates!!

Here are some reference links may help you.

http://docs.nuget.org/docs/creating-packages/hosting-your-own-nuget-feeds

http://docs.nuget.org/docs/reference/command-line-reference

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s