Repository navigation
Closed
NuGet/NuGet.Client
#4461Labels
Functionality:PackPriority:2Issues for the current backlog.Issues for the current backlog.Product:NuGet.exeNuGet.exeNuGet.exeTriage:InvestigateType:Bug
Milestone
Description
Maintainer edit
If you are still seeing this issue with the latest NuGet.exe version, please unblock the executable.
See: #9954 (comment)
Original report
For previous history on this problem, see issue #4234.
Using the exact same project and build:
NuGet Version 5.6.0.6591 does not display the Authors/Description error. However, version 5.7.0.6726 does.
I'm surprised this important issue doesn't seem to be regression tested. It's fixed, it comes back, it's fixed. . . .
5.6 output
nuget pack -verbosity detailed
NuGet Version: 5.6.0.6591
Attempting to build package from 'ClassLibrary1.csproj'.
MSBuild auto-detection: using msbuild version '16.7.0.37604' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
Packing files from 'C:\Users\charl\Google Drive\Development\NuGet Testing\NuGet Dependency Resolution\Framework Major-Numbered\ClassLibrary1\ClassLibrary1\bin\Debug'.
Using 'ClassLibrary1.nuspec' for metadata.
Add file 'C:\Users\charl\Google Drive\Development\NuGet Testing\NuGet Dependency Resolution\Framework Major-Numbered\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll' to package as 'lib\net472\ClassLibrary1.dll'
Id: ClassLibrary1
Version: 1.0.0
Authors: C
Description: D
Dependencies:
Added file '[Content_Types].xml'.
Added file '_rels/.rels'.
Added file 'ClassLibrary1.nuspec'.
Added file 'lib/net472/ClassLibrary1.dll'.
Added file 'package/services/metadata/core-properties/0a9c65c5d99145c6af36a7c3d0d48724.psmdcp'.
Successfully created package 'C:\Users\charl\Google Drive\Development\NuGet Testing\NuGet Dependency Resolution\Framework Major-Numbered\ClassLibrary1\ClassLibrary1\ClassLibrary1.1.0.0.nupkg'.
5.7 output
nuget pack -verbosity detailed
NuGet Version: 5.7.0.6726
Attempting to build package from 'ClassLibrary1.csproj'.
MSBuild auto-detection: using msbuild version '16.7.0.37604' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
Packing files from 'C:\Users\charl\Google Drive\Development\NuGet Testing\NuGet Dependency Resolution\Framework Major-Numbered\ClassLibrary1\ClassLibrary1\bin\Debug'.
Could not load file or assembly 'file:///C:\Program Files (x86)\NuGet CLI\nuget.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
Using 'ClassLibrary1.nuspec' for metadata.
Authors is required.
Description is required.
System.Exception: Authors is required.
Description is required.
at NuGet.Packaging.Manifest.Validate(Manifest manifest)
at NuGet.Packaging.Manifest.ReadFrom(Stream stream, Func`2 propertyProvider, Boolean validateSchema)
at NuGet.CommandLine.ProjectFactory.ProcessNuspec(PackageBuilder builder, String basePath)
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.RunPackageBuild()
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
Reacted by John, Zachary Sanders, Alex McCool, markoueis, Ben Below, Mario, Daniel Elkington, 884756834, astrowalker, Luis Quijada Serrano and 2 more
Metadata
Metadata
Assignees
Labels
Functionality:PackPriority:2Issues for the current backlog.Issues for the current backlog.Product:NuGet.exeNuGet.exeNuGet.exeTriage:InvestigateType:Bug
Activity
[-]NuGet again throws exceptions "authors is required" "description is required", ignoring csproj/nuspec replacement tokens[/-][+]NuGet again throwing exceptions "authors is required" "description is required", ignoring csproj/nuspec replacement tokens[/+]nkolev92 commentedon Aug 28, 2020
@bladewolf55 Can you please provide a repro?
The change for the issue you are mentioning was in 5.7, not 5.6
kartheekp-ms commentedon Aug 28, 2020
Thanks @nkolev92. I agree.
@bladewolf55 - I am unable to reproduce the issue. I created a
Classlibrary (.NET Framework)project inVS 2019 16.7.2and executednuget packcommand which produced following output with couple of NU5115 warnings for missing valuesDescriptionandAuthorin.csprojfile.Can you please provide a repro?
bladewolf55 commentedon Aug 29, 2020
Of course. I should have provided that the first time.
Environment
Steps to Reproduce
nuget specnuget packExpected: Successful build of new package
Actual: Error that Author and Description are missing:
This error does not happen using nuget.exe 5.6x, as specified in the OP.
zkat commentedon Aug 31, 2020
ping @rrelyea because hotseat. Can you confirm that this is an actual bug, or that a bugfix we did caused this to start (correctly) failing?
rrelyea commentedon Aug 31, 2020
n.h.9954.zip
Attached my repro attempt based on your instructions.
extract zip file.
have nuget.5.6.exe and nuget.5.7.exe in your path (or adapt repro.cmd)
cd n.h.9954
run repro.cmd (i used this: "repro.cmd 1> out.txt 2>&1")
my output:
so it appears that it was broken in 5.6 and is now fixed in 5.7.
What did we do differently?
bladewolf55 commentedon Sep 1, 2020
Here's my output using your zip file and running the command
"repro.cmd 1> out.txt 2>&1. You'll see it's different than your results. The only difference I see is the MSBuild version. But be sure to read after that, because I'm getting different behaviors depending on how I build and pack.So, here are a few other ways to build and release. In each case, I delete the bin/obj folders and .nupkg file to start. I put the nuget executables in the project folder.
Important: Ensure no other nuget.exe are on the Path
msbuild /p:Configuration=release /v:minimalnuget.5.6 pack -verbosity detailed -prop configuration=releaseGet authors/description errors
msbuild /p:Configuration=release /v:minimalnuget.5.6.exetonuget.exenuget pack -verbosity detailed -prop configuration=releasePack succeeds
Same as above, but with nuget.5.6.exe
nuget.5.6 packshows errorsnuget packshows errorsCopy
nuget.exe v5.7into same folder asnuget.5.7.exe(in other words,nuget.exeandnuget.5.7.exeare on the path.Run msbuild as above
Run
nuget pack nuget.5.7.exeas above.Pack succeeds
Run
nuget pack nuget.5.7.exeas above.Pack succeeds
However, using putting
nuget.exeversion 5.7 in the same folder doesn't succeed.Conclusions
There are past reports of nuget behaving differently if it's renamed. I don't know if there are also reports of the renamed executed file picking up behavior from another nuget.exe in the path.
My reproduction is, I think, a common use case: the latest nuget.exe in the path.
As I see it right now, there are three bugs:
I'm puzzled why I could never get 5.7 to succeed as you did. But then, you didn't truly reproduce my conditions; you mutated them. And we all know from X-Men what happens when there's mutation.
35 remaining items
robbyxp1 commentedon Oct 15, 2021
This took about 3 hours of my time. Unblocking it (5.11) fixes the issue. Make sure its called nuget.exe, right click on its properties, and at the bottom unblock it.
Sc0tTyXL commentedon Oct 15, 2021
I can confirm that the issue exists on v5.11 and that Unblocking fixes the issue!
dlech commentedon Jan 18, 2022
If manual unblocking is a requirement that can't be worked around, it would be super-awesome if nuget would spit out an error message that explained how to fix the problem instead of any unrelated error.
npakudin commentedon Feb 8, 2022
Version 6.0.0.280 - for me problem exists
erdembayar commentedon Feb 8, 2022
@npakudin
Please upvote this issue at top, we prioritize based on community upvote & engagement.
We're planning to add explicit message about need to
unblockon Windows.robbyxp1 commentedon Feb 9, 2022
The real solution of course would be to wrap the program in a proper installer, and then it would not be marked as blocked ;-)
luislhg commentedon Dec 28, 2022
I have nuget pack running this from an Azure Pipeline and thus my version is never set, always fixed in 1.0.0 because the$version$ is not read. How would I fix/unblock this on Azure/Cloud/Pipeline?
mrkimpossible commentedon Feb 23, 2023
In case somebody stumbles on this issue, I just replaced the token$author$ to $authors$ in the nuspec file. I'm even using version 6.4.0.123 which is the latest at the time of this writing.
The tokenized nuspec file gets generated after running nuget spec in a folder where a .csproj, .vbproj, or .fsproj exists.
alexhiggins732 commentedon May 7, 2023
I had same error about Description being required. In my case even though the
<Description>tag was set was set, another build property was setting<PackageDescription>.Changing the
<PackageDescription>tag to<Description>resolved the problem.