In Jenkins, during build, we encountered missing dlls, lot of them.
the following was checked and seemed ok
- “Enable Nuget Package Restore” was selected.
- nuget.exe had been added to source control.
- the version of the nuget packages was stable
to fix this, you don’t have to check in the packages folder to your repository that jenkins is pulling. Nuget should be able to tell which packages it needs and download any missing ones. Make sure the package file is up to date. The error (below) was a little different but the root issue was the same: missing packages.
The solution ended up being remarkably simple: repeat the steps we perform locally in source control.
- In Visual Studio, open the Source Control Explorer.
- Navigate to the packages folder (it should be on the same level as the projects in the solution).
- Right click and select “Delete”. A small red x should appear next to the name.
- Check in the pending change (deleting the packages folder) and wait.
If all goes well, that automatic build should kick off with the new check in and build successfully.
Note: the first build should take longer than usual as the server has to recreate the packages folder and download all packages.