Peter Morlion logo


A private feed for your organization via AppVeyor

If you’re working in the .NET stack regularly and don’t know AppVeyor yet, it’s definitely worth checking out.

AppVeyor is a CI system focused in .NET projects. You can easily link it to GitHub, Bitbucket and Visual Studio Online. It can build your project, run tests, deploy, and… publish to NuGet.

This is what I will cover in this post today.

When you have a piece of code that is repeated across two or more projects, it can be interesting, nay recommended, to put in in its own library. And AppVeyor includes its own private NuGet feed, making it easy to just commit code, and have it appear in the feed. No manual steps needed!

It just takes a few steps to set up, and you’re good to go.

nuspec file

First, add a nuspec file to the project you want to publish and fill in the details. For more info on what to put in there, check out the docs. If you’ve been publishing manually, you already have this file.


You can set up AppVeyor from the UI, but I prefer the YAML file, because it allows me to put this file in source control and see its changes and history.

This is an example of a simple file:

version: 1.0.{build}
image: Visual Studio 2022
configuration: Release
platform: Any CPU

# For classic .NET:
  patch: true
  file: '**\AssemblyInfo.*'
  assembly_version: '{version}'
  assembly_file_version: '{version}'
  assembly_informational_version: '{version}'

# For .NET Core, .NET Standard, ASP.NET Core:
  patch: true
  file: '**\*.csproj'
  version: '{version}'
  version_prefix: '{version}'
  package_version: '{version}'
  assembly_version: '{version}'
  file_version: '{version}'
  informational_version: '{version}'

- ps: iex ((new-object net.webclient).DownloadString(''))
- ps: >-
      if ($env:APPVEYOR_REPO_TAG -eq "true")
         $version = "$env:APPVEYOR_REPO_TAG_NAME.$env:APPVEYOR_BUILD_NUMBER"
         Write-Host "Setting version to $version"
         Update-AppveyorBuild -Version "$version"
         $version = "$env:APPVEYOR_BUILD_VERSION"
         Write-Host "Setting version to $version because there is no tag"
         Update-AppveyorBuild -Version "$version"
- cmd: dotnet restore # or nuget restore for classic .NET

  project: My.Solution.sln
  verbosity: minimal

  - provider: NuGet
    server: <your private nuget feed>
      secure: <your secured api key>
      APPVEYOR_REPO_TAG: true # only publish tags

What this does is:

  • set the version of the DLL to the version of the tag, if present (like 3.1.2)
  • publish to the private AppVeyor NuGet feed, if there is a tag

Using the package

To use this package, we need to add our private feed to our NuGet sources in Visual Studio. Go to Tools > NuGet Package Manager > Package Manager Settings and add the source. You can find the URL by going to AppVeyor, clicking the dropdown of your account, and choosing NuGet. If you’re already logged in, go to

You can also find your API Key there. Secure it using this tool:

As this is a private feed, Visual Studio will prompt you for your credentials when you use it.


If you’re already using AppVeyor, you can easily set up a private NuGet feed, with little configuration or manual steps. If you’re not using AppVeyor, check it out. It features a private NuGet feed 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *