.NET Tips and Tricks

Blog archive

Creating a NuGet Web Site

In my regular Practical.NET column, I showed how easy it is to create NuGet packages and discussed how it was a much better way for a developer to share anything you've created, from Entity Framework classes to JavaScript files (my example was a package that implemented an HtmlHelper consisting of a DLL and a JavaScript file). NuGet also allows you to attach searchable documentation to your package to ensure that a developer can find your package, recognize it and know what your code does.

In that article, I showed how to use a folder as a repository for NuGet packages. But if you'd like something a little more professional, you can create a NuGet Web site. It's easy to do: First, in Visual Studio, create an Empty Web Application. Once the project appears in Solution Explorer, right-click on it and select Manage NuGet Packages. In the NuGet Package Manager, do a search for the NuGet.Server package and install it.

After deploying your Website, you just need to do two things:

  1. Save your NuGet packages into the Packages folder in your new site.
  2. Tell Visual Studio about your site.

My earlier article walks through both processes. You can get the information for your site by surfing to it with your browser -- its default page provides both the file path to the folder you should save your package in and the URL you should use when telling Visual Studio about your NuGet site.

I'll put in one caveat: I only tested this on IIS 7.

Posted by Peter Vogel on 12/03/2015


comments powered by Disqus

Featured

Subscribe on YouTube