NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 253 forks source link

System.NullReferenceException: Object reference not set to an instance of an object #7620

Open zivkan opened 5 years ago

zivkan commented 5 years ago

@astrowalker commented on Mon Dec 10 2018

NuGet Version: 4.9.1.5694 (CLI)

For the record version 4.7.1 behaves the same way.

I tried to make a custom package out of FSharp.Data (https://github.com/fsharp/FSharp.Data) -- I added my nuspec and key -- and then I executed:

c:\tools\nuget pack FSharp.Data.fsproj -includereferencedprojects -prop configuration=release -verbosity detailed

As the result I got exception:

Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2 packagesAndDependencies)
   at NuGet.CommandLine.ProjectFactory.RecursivelyApply(Action`1 action, Object alreadyAppliedProjects)
   at NuGet.CommandLine.ProjectFactory.RecursivelyApply(Action`1 action)
   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.Commands.PackCommandRunner.BuildPackage()
   at NuGet.CommandLine.PackCommand.ExecuteCommand()
   at NuGet.CommandLine.Command.ExecuteCommandAsync()
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)

My point is, even if there is something wrong, the result should be like "detected recursive dependencies" and not a raw exception.

nkolev92 commented 5 years ago

@zivkan Do we have a repro here?