7
votes

I have a project, which uses Chutzpah to run unit tests, however the project does not use Chutzpah any other way, it only uses its command line interface. When I installed the Chutzpah NuGet package, the reference was added to .nuget\packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
    <package id="Chutzpah" version="2.4.3" />
</packages>

I have package restore enabled for this project and the build successfully restores all other used packages but not Chutzpah. I assume it has to do with the fact, that the package reference is located in .nuget\packages.config and not in a project packages.config file, but I don't know why this happened and what is the correct way to work with this?

The Chutzpah NuGet package was added to the project via Visual Studio to a specific project.

To work around the issue I moved the package reference to a project packages.config file and the restore works fine.

1
i'm sure the real answer involves changing the nuget.targets file to include the .nuget folder in addition to the solution folders... but I took your shortcut for nowJeff Martin
If you use the newer Automatic Package Restore does this problem go away?Michael Richardson
I've had this problem before, I find that reinstalling the problem package updates the references to it. docs.nuget.org/docs/workflows/reinstalling-packagesjennas

1 Answers

1
votes

Package Restore will not automatically restore solution-level packages. You will need to add a build step to get NuGet to restore the solution packages. For example:

.nuget/nuget.exe install .nuget/packages.config -o packages

For more information see this post on solution level packages.