Visual Studio Team Services – NuGet Packages

Visual Studio Team Services – NuGet Packages

Since a couple of months you can download an extension for Visual Studio Team Services (VSTS) to manage your own NuGet packages. The extension is called Package Management. It’s is still in preview, but Microsoft supports it already as were it released. With this tooling you can host your own NuGet feed, containing your – or other custom NuGet packages. The big advantage is that you can share NuGet packages with your organization. They are available for consuming from your Team Build too. Beside version control, workitem management and tracking bugs, in my opinion Team Build is a key feature of VSTS, so this is really great news!

Feeds

You can organize your packages into feeds. A feed is a container for packages. Right now, feeds may only contain NuGet packages, but soon they will also be able to contain packages in other formats. Feeds have protocol-specific URLs to which packaging clients can connect. For example, you can connect to a feed with nuget.exe using the feed’s NuGet package source URL. You can secure feeds separately with permissions. This allows you to control who can access and update packages.

vstspackagemanagement

As actually for every NuGet repository, you can manage many versions of your NuGet package.

Publishing a package

Currently the process of publishing a package is still done by calling NuGet.exe from the command line. I expect that in the future you will able to publish a NuGet package by uploading it from for example a web page. Other vendors, like MyGet, do have a user friendly interface for pushing packages. But for now, the command prompt will be your best friend. You need your package source, api key, username and password. The credentials will expire by default. But under your Account > Security you can create new Personal Access Tokens.

Consuming the packages

As told earlier you can refer to the NuGet feed from your Team Build. Of course you can also consume the feed from Visual Studio 2015 or Visual Studio Code. Add the NuGet package source via Tools > NuGet Package Manager > Package Manager Settings > Package Sources. Add the URL and you can manages packages just like every other package store.

NuGet Packages made our lives as Microsoft developers much easier. The fact that you can host your own NuGet packages in VSTS makes the story complete. It’s free, so you can start today!

Leave a Reply