0

I'm currently trying to create a build plan in Bamboo for an ASP.NET MVC project. I've setup my build plan to call nuget.exe to get the packages required for the build. However, the Nuget restore operation is putting the nuget files into different directories than is specified, thus causing build issues.

Below is an extract of two of the Nuget packages in my packages.config file which are causing the problems:

<package id="Owin" version="1.0.0" targetFramework="net46" userInstalled="true" />
<package id="Unity" version="3.5.1404" targetFramework="net46" userInstalled="true" />

The restore operation works correctly, but the packages are downloaded into incorrect directory names. For example, the Owin package is downloaded into packages\Owin.1.0 when it should be packages\Owin.1.0.0. The unity package is downloaded into a packages\Unity.3.5.1404.0

It should be noted that the position of those two lines are like that in the packages.config file (i.e. Unity directly follows the Owin package), so I don't think it's a coincidence that the directory that looses the .0 is directly before the package definition that gains the 0.1.

The command in Bamboo is just calling the Nuget.exe file with the following command parameters: restore "${bamboo.build.working.directory}\checkout\path\to\Solution.sln" -ConfigFile "${bamboo.tools.directory}\nuget\nuget.config"

EDIT: This behaviour is reproducable on a completely different system, by downloading the nuget command line utility and running the following from the command line: nuget restore "../path/to/solution.sln" -ConfigFile "nuget.config"

Juzzbott
  • 1,737
  • 2
  • 25
  • 44

1 Answers1

0

So, it turns out for some reason that Nuget is downloading Owin.1.0.nupkg and Unity.3.5.1404.0.nupkg files, which is where the incorrect directory names are coming from.

Output from the nuget restore command:

Installing 'Owin 1.0'.
Installing 'Unity 3.5.1404.0'.
Successfully installed 'Owin 1.0'.
Successfully installed 'Unity 3.5.1404.0'.

So while it's a far less than ideal solution, I guess I'm going to have to create a build step to rename the erroneous directory names.

Juzzbott
  • 1,737
  • 2
  • 25
  • 44