Wrong version of a library is packaged in nuget

We have a solution with two projects:

ProjectA references a Newtonsoft JSON.NET v4.5
ProjectB references the same Nuget package v7.0
Both projects have Octopack.

After TFS builds a deployment would fail because ProjectA’s OctoPack nuget contains v7.0 while ProjectB contains v4.5. Most of the time the deployment is fine. It happens intermittently in about 10% of cases. It is as if they swap versions or Octopack/TFS uses some shared directory for parallel builds and grabs the wrong version.

Is there any explanation for this behavior? We can upgrade both projects to 7.0 but the behavior is kind of weird.

Btw thank you for the wonderful product!



This appears to be related to SingleFolder setting in TFS build and not to OctoPack.

Hi Sergey,

Thanks for getting in touch. I’d suggest you’re right. OctoPack doesn’t do much beyond figure out what files should be packaged, and call NuGet to pack the files in to a .nupkg file.

The resulting .nupkg file will be the result of whatever files happen to be in the source folder(s) at the time NuGet is executed, and if TFS is changing those files you’ll get non-deterministic results.

Hope that helps!

I’ve been working with Microsoft on this exact issue for several months. Did you find a solution?

As a matter of fact I did. I did this:

  1. set TFS build to PerProject
  2. add this parameter to MSBuild command line in the TFS build definition.


it worked, at least for me. Now TFS keeps binaries in per project bin folders and Octopack works okay.