Error: Please run 'dnu restore' to generate a new lock file
Well thank you for that helpful message Mr restore Nuget packages. I had done a pull and tried to build the solution which in turn tries to restore the packages. That failed and I was prompted to do it manually.
That certainly didn’t work, but I tried a few more times before I reminded myself of the saying “The definition on insanity is trying the same thing over and over again expecting a different result”. I pulled up procmon, my most beloved Windows tool, and took a look at the fun that yielded this error after I tried the suggested restore:
Error NU1006 Dependencies in project.json were modified. Please run “dnu restore” to generate a new lock file. SpamBlocker c:\users\something\documents\visual studio 2015\Projects\projectX\src\ProjectX\project.lock.json 1
I added a filter on dnu.exe after seeing a lot of activity from that process, and then took a look at the first activity that involved the json.dat file.
I decided to take a closer look
I then decided to run exactly that call manually:
“C:\Users[user].dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\dnx.exe” “C:\Users[user].dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-update1\bin\lib\Microsoft.Dnx.Tooling\Microsoft.Dnx.Tooling.dll” restore “c:\users[user]\documents[projectsrc]” -f “C:\Program Files (x86)\Microsoft Web Tools\DNU”
And look at that, on the next attempted restore all was good. YAY!
You can read more about the dnu.exe here - and the different arguments you can pass in
Comments
Used to be a few updates behind on my work machine so it might be it. Installing 2017 now (what can possibly go wrong?). Thanks for the tip!
Last modified on 2016-11-12