packagenugetfile-location

Trouble with nuget pack


I am using Nuget.exe version 4.3.0.4406 with a local nuget gallery and am seeing a mismatch between package locations.

When I install a package it installs to c:\projects\ProjectX.1.0.0.0.

However when I try to pack a project that references ProjectX then it appears to be looking for a path like c:\projects\ProjectX\1.0.0.0.

Just to clarify, the nupkg does exist where nuget put it under ProjectX.1.0.0.0 however it appears to look for references using ProjectX\1.0.0.0.

The actual error I get is:

    Missing C:\Projects\packages\projectX\1.0.0.0\projectx.1.0.0.0.nupkg
Unable to find 'ProjectX.1.0.0.0.nupkg'. Make sure the project has been built.
NuGet.CommandLine.CommandLineException: Unable to find 'ProjectX.1.0.0.0.nupkg'. Make sure the project has been built.
   at NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2 packagesAndDependencies)
   at NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder builder)
   at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded, PackageBuilder builder)
   at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
   at NuGet.CommandLine.PackCommand.ExecuteCommand()
   at NuGet.CommandLine.Command.ExecuteCommandAsync()
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)

Solution

  • It seems the solution for me was to include

    developmentDependency="true"
    

    in the offending packages and then in also include them in the dependencies section of the nuspec.