Bizarre NuGet.exe 5.7 "authors is required" behaviors
2020-10-23 10:44
Are you using nuget.exe
to generate packages, especially as part of your continuous integration? If you've upgraded to version 5.7, you may be experiencing unexpected errors like this:
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 '[project]].nuspec' for metadata.
Authors is required.
Description is required.
I've submitted a bug report which is slowly gaining traction, but to my knowledge isn't yet resolved. Here's a summary of the problem and conditions. Please follow the link for more details.
Problem
- The [project].nuspec's token substitution isn't working, e.g. substituting AssemblyConfiguration for \(author\).
- Applies to .Net Framework NuGet projects being packaged using
nuget.exe
Conditions
The error will occur under the following conditions
- Version 5.6 is named
nuget.5.6.exe
. E.g. the command used isnuget.5.6 pack
- Version 5.7 is named
nuget.exe
. E.g. the command used isnuget pack
You may get conflicting behaviors if:
- You have both version 5.6 and 5.7 in your PATH
Mitigation
- Use
nuget.exe
version 5.6. - Ensure only one
nuget.exe
version is in the PATH - Name the file
nuget.exe