This was a bloody one, so here is an advice:
Pay extra attention when you use NuGet package manager and update a dependency that is used in more than one of your projects!
So, why is it broken? Let me explain…
This is our solution structure:
Both highlighted projects use the NuGet package “RavenDB.Embedded”. Recently we had an issue with a customer that was fixed in build 2024. So, I used the package manager window to update to RavenDB build 2025:
I then pushed the commit to our repository and TeamCity started the psake task to build and deploy the package. This worked great – the issue was fixed!
Since then (about 2 weeks) we shipped about 30 new builds of our software and had no problems. However, the issue re-appeared today and it was exactly the same problem that we had back then.
After some headaches I found out that for some reason we were deploying RavenDB version 2005 again, although the NuGet package clearly was on build 2025!
I have to admit – it took me some time to figure this… the problem was that NuGet update works per project and not for the whole solution! So, while one project was on version 2025, the other still was on 2005:
I can’t get my head around why I would want to update only one project but leave the other untouched. This makes absolutely no sense to me and apparently it causes some issues with msbuild as well (was shipping the newer version before but then returned for no reason).
I hope that this weird behavior will be fixed with an upcoming NuGet version (this was 2.0), but until then we must remember to update NuGet packages in every project of the solution!