Example scenario: Your team publishes a shared MyCompany.Logging NuGet package to Azure Artifacts. Another team adds the feed to their project’s NuGet.config and installs the package like any normal NuGet dependency. 3⃣ How do you version your NuGet packages in a CI/CD pipeline?
Versioning is usually handled automatically in the build pipeline — so every build produces
a unique version number.
You can version packages using:
- Build ID, Git commit hash, or semantic versioning (e.g., 1.2.3).
Example (YAML):
variables:
versionMajor: 1
versionMinor: 0
versionPatch: $(Build.BuildId)
Follow:
steps:
- script: dotnet pack MyLibrary.csproj -c Release
- p:PackageVersion=$(versionMajor).$(versionMinor).$(versionPatch)
displayName: 'Create NuGet package'
Then publish it:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '**/*.nupkg'
publishVstsFeed: 'MyProject/MyFeed'
Example scenario:
Each time your CI pipeline runs, it generates a package version like 1.0.45 or 1.0.46 —
ensuring consistent versioning and avoiding overwriting old packages.
4⃣ How do you manage dependencies between multiple .NET projects
using Azure Artifacts?
When you have multiple .NET projects that depend on each other, Azure Artifacts acts as
your internal package registry.
Typical approach: