When using Paket, how to fix this error?
2 Answers
Option 1
The easiest way to fix this error is to delete the file paket.lock
, and force Paket to regenerate this file using Tools >> Paket >> Update
:
You can watch the paket.lock
being regenerated in the Output
view:
Ensure that these files have already been committed into source control, so you can roll back if need be.
Option 2
Alternatively, you can do exactly what is says: edit the paket.lock
file to include the file that is referenced in paket.references
, but not in paket.lock
.
Docs on paket.lock file
For more information, see docs on the Paket Lock File.

- 76,540
- 58
- 260
- 305
-
Might be worth noting that Option 1 will result in new versions of all dependencies, where the dependencies have been updated to a new version(s) since the last generation of the paket.lock file. – bentayloruk Jul 18 '18 at 11:45
This issue can be caused when you add a package reference to your project's paket.references
file, but you have not actually added the dependency to your paket.dependencies
file. To resolve this, add the dependency to paket.dependencies
and then run paket.exe install
. This will add the new dependency to paket.lock
and leave the existing dependency versions as they were.
If you are using paket groups, don't forget that the dependency will need to be added once for each group that wishes to reference it.

- 4,060
- 29
- 31