NuGet Package Sources
Introduction
OneCompute is a set of libraries that are made available as NuGet packages. NuGet packages make it quick, easy and convenient to get the required OneCompute dependencies into your Visual Studio solution so that you can focus on writing an application that targets OneCompute.
This article describes how to get access to the NuGet Package feed, and then how to configure Visual Studio to connect to the feed where the OneCompute packages are located.
Prerequisites
There are a number of prerequisites required before you can connect Visual Studio to the NuGet Package feed which are outlined below. More details are provided in the following sections of this article.
- Visual Studio 2022 with the latest update.
- .NET 6.0 or higher (installed by default in Visual Studio 2022)
- An Azure DevOps Package Management License.
Azure DevOps (ADO) Package Feed
DNV has a Package feed hosted in the Azure DevOps (ADO) One account. This package feed hosts the packages of many OneFoundation components, including OneCompute.
The NuGet Package Management functionality provided by ADO is licensed such that each user must have a license to access the contents of the feed. So even if you only need to consume packages from the feed rather than publish and manage packages in the feed, you still need to have a license.
Note
Visual Studio Enterprise subscription holders do not need to obtain access separately because access is provided as part of your Enterprise subscription.
Licenses to access the DNV "One" Package Feed should be requested through the DNV Store. You need to request an Azure DevOps Package Management license for DNV - Digital Solutions.
Connecting to the One NuGet Package Source in Visual Studio
Configuring Visual Studio to connect to a NuGet Package Source only needs to be done once. Visual Studio will remember your settings so you don't have to enter them again.
- Open Visual Studio.
- Select Tools > NuGet Package Manager > Package Manager Settings to open the Options dialog.
- In the tree on the left, select Package Sources.
- Click the green "Plus (+)" button to define a new package source.
- In the Name text box, enter One v3.
- In the Source text box, enter https://dnvgl-one.pkgs.visualstudio.com/DefaultCollection/_packaging/One/nuget/v3/index.json.
- Click the Update button.
- Make sure the checkbox next to the One v3 package source is checked on.
Your Options dialog should now look similar to this:
Click the OK button to close the dialog.
You have now configured Visual Studio to connect to the One NuGet Package Source in Visual Studio. To confirm that everything is configured correctly, you can try running through the Creating a client and worker from scratch tutorial. This tutorial builds a basic OneCompute application from scratch using the NuGet Package Source that you just configured.
Next
Now you are ready to set-up a OneCompute solution.