5

I'm using Visual Studio Online with Visual Studio 2013. The build fails with

You are trying to build with OctoPack, but the NuGet targets file that OctoPack depends on is not available on this computer. This is probably because the OctoPack package has not been committed to source control, or NuGet Package Restore is not enabled

According to this link https://octopusdeploy.com/blog/octopack-3.0 I need to make some changes to get package restore working properly, but another link within the previous one says that no configuration is required if using VS2013 and Visual Studio Online Nuget.org

When I build in VS all of the packages get restored first and then the project builds. Also if I build the project and invoke Octopack via command line everything works fine. Thoughts?

The Muffin Man
  • 19,585
  • 30
  • 119
  • 191

3 Answers3

5

If you do run NuGet Package Restore before building, this should work. However, make sure the path in your project file referring to OctoPack.targets is correct - you might have moved your packages folder or the project file and the relative paths no longer match. Easiest way to fix it would be to run Update-Package -Reinstall Octopack.

skolima
  • 31,963
  • 27
  • 115
  • 151
2

NuGet Package Restore was recently changed so you wouldn't need to include NuGet in the solution to do a package restore. However, OctoPack still needs NuGet on the path so it can find it. You can try explicitly specifying the path to NuGet by adding this parameter when calling OctoPack.

/p:OctoPackNuGetExePath=<path>\nuget.exe
Daniel Little
  • 16,975
  • 12
  • 69
  • 93
  • Octopack includes Nuget though. If you look in the package it downloads it has NuGet.exe in the tools folder. Only way I could get this to work was to check Octopack and all of its children into source control. Sucks, but couldn't get it working any other way. – The Muffin Man Aug 08 '14 at 16:30
  • Same problem. Same solution. – Kye Nov 17 '15 at 20:56
2

You just need to check in the Octopack targets file.

\packages\OctoPack.2.0.26\targets\OctoPack.targets

Scorch
  • 83
  • 3