Step-by-Step Guide: Creating a NuGet Package Feed to Host Artifacts
🔹 Step 1: Create a C# Class Library and Generate NuGet Package
- Open Visual Studio.
- Go to
File → New → Project
. - Select Class Library (.NET Standard) or .NET Framework.
- Name the project (e.g.,
ClassLibrary1
) and click Create. - Right-click the project in Solution Explorer and select Properties.
- Go to the Package tab.
- Check Generate NuGet package on build.
- Fill in metadata fields as needed (Package ID, Version, Author, etc.).
- Build the project in Release mode.
Note: The .nupkg
file will be generated in bin\Release\
.
🔹 Step 2: Set Up a NuGet Feed in Azure DevOps
- Go to Azure DevOps Portal and log in.
- Create a new project named
Own-Artifacts
. - Click Create.
- In the left-hand menu, click Artifacts.
- Click + Create Feed.
- Enter the following:
- Name:
Feed-OwnNuGet
- Visibility: People in your cloud user
- Name:
- Click Create.
🔹 Step 3: Publish the NuGet Package to Azure DevOps Feed
- Ensure
nuget.exe
is installed and available in your system path. - Open a Command Prompt or Developer Command Prompt.
- Run the following command:
nuget.exe push -Source "https://pkgs.dev.azure.com/clouduser/Own-Artifacts/_packaging/Feed-OwnNuGet/nuget/v3/index.json" -ApiKey az "D:\hc-git\ClassLibrary1\bin\Release\ClassLibrary-hc1.1.0.0.nupkg"
Note: Replace the path with the actual location of your .nupkg
file.

NuGet Feed

✅ Summary
- You created a class library and generated a NuGet package.
- You set up a private NuGet feed in Azure DevOps.
- You published the package to your own feed.