Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Integrated NuGet package restore

AppHarbor integrates NuGet package restore as part of the build process. Package restore will be invoked when there is a solution file present in your repository and before running MsBuild. This means the packages will be available when MsBuild builds your application.

Automatically restoring packages is generally a recommended practice. This is particularly because you don’t have to commit NuGet packages and binaries to your repository and can keep your repository’s footprint small as a result.

Until recently we've recommended using the approach outlined in this blog post to restore NuGet packages when building your application on AppHarbor. You can now remove most of the files added by NuGet package restore, but it might still be necessary to add a separate configuration file.

Configuration

You can configure NuGet with a NuGet.config or a .nuget\NuGet.config file in the same directory as the solution. Documentation for the NuGet configuration file is available here. If you’re only using the official NuGet feed you likely don’t have to configure anything, but you’ll need to configure NuGet if your application relies on other package sources.

If you need to configure your own package source you may want to use this as a template:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="NuGet official package source" value="https://nuget.org/api/v2/" />
        <add key="Your package feed" value="https://myget.org/your-package-feed" />
    </packageSources>
</configuration>