Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Private NuGet Package Manager in Visual Studio Team Services

DZone's Guide to

Private NuGet Package Manager in Visual Studio Team Services

How to install and use Microsoft's official add-in to host a private NuGet package inside of VSTS.

· Agile Zone
Free Resource

Reduce testing time & get feedback faster through automation. Read the Benefits of Parallel Testing, brought to you in partnership with Sauce Labs.

One of the cool feature of Visual Studio Team Services is extendibility, you can also find lots of addin in official Marketplace. One of the coolest add-in's you can find there is an official add-in by Microsoft and allows you to host a private Nuget Packages inside your VSTS account. You can find the add-in here: https://marketplace.visualstudio.com/items?itemName=ms.feed it is free and can be installed with a couple of simple clicks.

image

Figure 1: Package manager add a new PACKAGE menu to your VSTS Account

As you can see the Package manager is still considered to be in Preview (asterisk after the menu and a nice toolbar that link to the documentation), but you can use it because all the basic funcionalities are present.

One of the nice aspect of package management is security: you can publish private packages, and you can decide who can access that specific package. You can start pressing the “New Feed” button in the feed page to create a new feed.

image

Figure 2: Create a new feed.

After the feed is created, you can simply right-click it and choose Edit to manage security with great granularity. As you can see in Figure 3 you can specify who owns the feed, who can publish packages to the feed, and finally who can read packages from that feed. With this level of granularity, you can easily protect your packages from unwanted use.

image

Figure 3: Package management security page.

Once the feed is created, you can press the “Connect To feed” link to gather all the information needed to consume and publish packages. You can find instruction for VS2015, VS2013 or other tools / nuget versions.

image

Figure 4: Instruction on how to connect to the feed for Visual Studio 2015.

Once the feed is created the easiest way to populate it is using a TFS Build, the whole process is explained on the post Publishing a Nuget package to Nuget/Myget with VSO Build vNext.

The main difference is that a private feed can use standard VSTS authentication, you just configure the feed as Internal NuGet Feed and put the address of the feed in Nuget Publisher Task Configuration. You can see from Figure 3 that Project Collection Build Service is included in the Contributor list, this allows a build service to publish packages to that feed during a build.

image

Figure 5: Nuget Publisher task can publish Internal NuGet feed without the need for authentication.

Once the build is finished, you can simply check if the package was correctly published to the feed.

image

Figure 6: Check your published package in feed management.

You can now consume the package from whatever client you like: Visual Studio, Command Line, etc.

The Agile Zone is brought to you in partnership with Sauce Labs. Discover how to optimize your DevOps workflows with our cloud-based automated testing infrastructure.

Topics:
visual studio ,team collaboration

Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}