Home: nuget 3.4.3 release - getting Value cannot be null on package build

Created on 23 Apr 2016  Â·  13Comments  Â·  Source: NuGet/Home

As of todays release our packagebuilder stopped functioning. Looks like it auto updated nuget.exe to 3.4.3 and now we get errors with building a package from a nuspec file. Below is the log:

2016-04-22 16:20:34 [INFO] : NuGet Packager 2.0.3
2016-04-22 16:20:35 [INFO] : Updating NuGet...
2016-04-22 16:20:37 [INFO] : Checking for updates from https://www.nuget.org/api/v2/.
2016-04-22 16:20:37 [INFO] : Currently running NuGet.exe 3.4.3-rtm-0855.
2016-04-22 16:20:37 [INFO] : Updating NuGet.exe to 3.4.3.
2016-04-22 16:20:37 [INFO] : Update successful.
2016-04-22 16:20:37 [INFO] : Creating package...
2016-04-22 16:20:38 [INFO] : Attempting to build package from 'Package.nuspec'.
2016-04-22 16:20:38 [ERROR] : System.ArgumentNullException: Value cannot be null.
2016-04-22 16:20:38 [ERROR] : Parameter name: folderName
2016-04-22 16:20:38 [ERROR] : at NuGet.Frameworks.NuGetFramework.Parse(String folderName, IFrameworkNameProvider mappings)
2016-04-22 16:20:38 [ERROR] : at NuGet.Packaging.ManifestReader.<>c.b__7_2(NuGet.Packaging.<>f__AnonymousType52 <>h__TransparentIdentifier0) 2016-04-22 16:20:38 [ERROR] : at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
2016-04-22 16:20:38 [ERROR] : at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
2016-04-22 16:20:38 [ERROR] : at System.Linq.Enumerable.ToListTSource
2016-04-22 16:20:38 [ERROR] : at NuGet.Packaging.ManifestReader.ReadMetadata(XElement xElement)
2016-04-22 16:20:38 [ERROR] : at NuGet.Packaging.ManifestReader.ReadManifest(XDocument document)
2016-04-22 16:20:38 [ERROR] : at NuGet.Packaging.Manifest.ReadFrom(Stream stream, Func2 propertyProvider, Boolean validateSchema) 2016-04-22 16:20:38 [ERROR] : at NuGet.Packaging.PackageBuilder.ReadManifest(Stream stream, String basePath, Func2 propertyProvider)
2016-04-22 16:20:38 [ERROR] : at NuGet.Packaging.PackageBuilder..ctor(String path, String basePath, Func`2 propertyProvider, Boolean includeEmptyDirectories)
2016-04-22 16:20:38 [ERROR] : at NuGet.CommandLine.PackCommand.CreatePackageBuilderFromNuspec(String path)
2016-04-22 16:20:38 [ERROR] : at NuGet.CommandLine.PackCommand.BuildFromNuspec(String path)
2016-04-22 16:20:38 [ERROR] : at NuGet.CommandLine.PackCommand.BuildPackage(String path)
2016-04-22 16:20:38 [ERROR] : at NuGet.CommandLine.PackCommand.ExecuteCommand()
2016-04-22 16:20:38 [ERROR] : at NuGet.CommandLine.Command.ExecuteCommandAsync()
2016-04-22 16:20:38 [ERROR] : at NuGet.CommandLine.Command.Execute()
2016-04-22 16:20:38 [ERROR] : at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
2016-04-22 16:20:38 [INFO] : Exit Code: 1

Pack Bug

All 13 comments

Can you please share the package/nuspec or a simple repro so we can verify the scenario?

yes, we are using the nugetpackage.ps1 which checks for updates of nuget and handles the packaging. The line:

$packageTask = Create-Process .\NuGet.exe ("pack Package.nuspec -Verbosity Detailed")

is what kicks things off for packaging.

Our attached Package.nuspec is pretty standard.
package.nuspec.txt

I thought it might be the pathing in the but I've tried putting in the full path and other variations as well to no avail. If I revert to the nuget3.4.3-rtm, and comment out the update check in the script, it works.
Thanks

I pulled down the latest nuget code but was unable to load it or compile. I'm looking through nuget3.4.3 release which did load, but wouldn't compile and walked the stack from the log. From what I can tell, the issue is in NugetPackaging.ManifestReader.ReadFrameworkAssemblies.

In the linq query, it calls into an extension method, "GetOptionalAttributeValue("targetFramework") and passes that to NuGetFramework.Parse(folderName,mappings)..

Since I am not specifying the optional attribute, "targetFramework", in my nuspec for each frameworkAssembly in frameworkAssemblies, the extension method returns null for the path. The first thing parse() does is throw an ArgumentNullException when no foldername is passed in.

Thanks, first take the 3.4.3 branch. Second compile from command line.

Will get a fix out on Monday

@chrisrestall - can you please help verify that this has fixed this issue?

  1. download not yet final version 3.4.4. of nuget.commandline.nupkg from https://www.myget.org/F/nugetbuild/api/v2/package/NuGet.CommandLine/3.4.4-rtm-870
  2. rename the .nupkg to .zip
  3. Grab nuget.exe from inside the zip file in the tools directory.
  4. Try this version of nuget.exe to verify that it has fixed your issue.
  5. Tell us how it went

I commented out the auto updater line in the ps script and used the rtm-exe. No issues. Thanks for jumpi9ng on this so quickly!
Date: Thu, 28 Apr 2016 16:34:48 -0700
From: [email protected]
To: [email protected]
CC: [email protected]; [email protected]
Subject: Re: [NuGet/Home] nuget 3.4.3 release - getting Value cannot be null on package build (#2648)

@chrisrestall - can you please help verify that this has fixed this issue?

download not yet final version 3.4.4. of nuget.commandline.nupkg from https://www.myget.org/F/nugetbuild/api/v2/package/NuGet.CommandLine/3.4.4-rtm-870

rename the .nupkg to .zip
Grab nuget.exe from inside the zip file in the tools directory.
Try this version of nuget.exe to verify that it has fixed your issue.
Tell us how it went

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@toddm Please include commit hashes on the issue, reopening for validation

Verified using customer's .nuspec with 3.4.4.870 build. Closing...

We have a failing AppVeyor PR build over on autofac/Autofac.Wcf#5 caused by this same issue. Do you have an ETA for the 3.4.4 release? Looks like it's close to RTM based on the version number on your MyGet feed. :smiley:

Is 3.4.4 released? Most of our AppVeyor builds are still failing with no apparent reason and it seems connected to this.

3.4.4-rc has been released. The final version not quite yet. You can find the rc here: https://dist.nuget.org/index.html

Was this page helpful?
0 / 5 - 0 ratings