Jamie Rees
Jamie Rees

Reputation: 8183

Github and Nuget packages

I am attempting to contribute to a project on Github (First time). I added a new Project to the solution and added NUnit and AutoFixture (via Nuget), now when I clone that repo it's missing all of the references to NUnit and AutoFixture.

Now when I did a pull request (before I knew it was missing the references) it kicked off an AppVeyor build and that failed badly...

C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5):
warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.core.interfaces".
Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. 
[C:\projects\projectName\Client.Tests\Client.Tests.csproj]

I am not sure how to fix this, does anyone have any ideas? I've searched the internet with no luck...

Upvotes: 1

Views: 1255

Answers (1)

Terje Sandstrøm
Terje Sandstrøm

Reputation: 1991

On AppVeyor you must add a pre-build step for restoring the nuget packages. Use the "Before Build script", Build tab, and add a "Nuget restore" command there. See details in the "Restoring NuGet packages before build" section on AppVeyor nuget docs

Visual Studio default setup is to allow "Allow Nuget to download missing packages", and "Automatically check for missing packages during build in VS", so other people should not have an issue. I would suggest you add this info to a readme.md file in your project, that way it is easily seen.

Don't do any Enable Package Restore, that is the old pre- Nuget 2.7 version way, and it will go away in Nuget 3 anyway. It also clutters up your project, and is a nuisance to get rid of.

Upvotes: 2

Related Questions