Build and test ASP.NET Core application using AppVeyor

For those who do not know, AppVeyor is Continuous Integration and Deployment service for .NET projects. It is free for open-source projects.

Currently, AppVeyor supports latest DNX version (1.0.0-rc1-final) and I’ve recently migrated my pet project to this version. I will show you how easy it is to build and run all unit tests on CI server every time you commit to GitHub.

Visual Studio project (MSBuild)

In LearnWordsFast project we are using Visual Studio 2015 as a development environment, so in AppVeyor we can use default configuration with a bit of tweaking.

By default AppVeyor will use MSBuild to build your project. Here is the steps needed to configure AppVeyor:

  • Restore nuget packages.  Set dnu restore as “before build script” in build settings.
  • Configure custom test command. Set dnx -p test/LearnWordsFast.Test test script in a test settings.

Now your project is ready for build and test. Just press “New Build” button.

It is also recomended to keep your CI settings in a repo. So just put appveyor.yml in your repo:

You can use following links as examples:



DNX project

I have also created “pure” dnx project. No *.sln or *.xproj files. To build it with AppVeyor you just need to change build script setting

Set dnu build src\Backend test\Backend.Test as a cmd script in build settings.

I have also added one optimization to reduce build time. By default, every time you build your project AppVeyor creates a clean environment. We can save our packages folder, so dnu restore does not need to download all packages every build. Add C:\Users\appveyor\.dnx\packages folder to “Cached directories and files” in Environment settings.

Resulted appveyor.yml:

You can use following links as examples:



You can just copy EmptyDnxApplication repo and use it as a skeleton for your own projects.

In the next article, I will show you how to deploy your APS.NET 5 application to a Linux server using AppVeyor deployment functionality.

Leave a Reply

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