-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NuGet again throwing exceptions "authors is required" "description is required", ignoring csproj/nuspec replacement tokens #9954
Comments
@bladewolf55 Can you please provide a repro? The change for the issue you are mentioning was in 5.7, not 5.6 |
Thanks @nkolev92. I agree.
Can you please provide a repro? |
Of course. I should have provided that the first time. Environment
Steps to Reproduce
Expected: 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. |
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? |
Attached my repro attempt based on your instructions. my output:
so it appears that it was broken in 5.6 and is now fixed in 5.7. |
Here's my output using your zip file and running the command
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
Same as above, but with nuget.5.6.exe
However, using putting 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. |
Thank you for shepherding this along. It's likely, in continuous integration environments, NuGet is automatically updated to its latest version. Unexpected behavior can cause significant problems and confusion. I don't want to see that happen and will help how I can. |
I'm using NuGet 5.7.0.6726 and this still has to be fixed. Reading this thread I'll give a try to the 5.6.something version. EDIT: I did try with version 5.6.0.6591 and it works as OP has correctly reported |
I am also getting this issue. I upgraded my build server and installed the newest version of development tools, including NuGet Version: 5.7.0.6726 and now all of my previously passing builds fail due to the error. Old build server has NuGet Version: 5.6.0.6591 and works fine. I'll be reverting back to this version until a fix is made. |
Upgraded from 5.5 to 5.8 and now have this issue when doing nuget pack |
Thanks for the update @lezmaka & @bladewolf55. That's probably one of the reasons we haven't been able to repro it locally. |
I also confirm that the issue is solved by unblocking the nuget.exe for versions higher then 5.6. The funny thing is that the issue is not there for version 5.6 even when the exe is still blocked. Also for troubleshooting hard to reproduce issues it's always the best approach do try to reproduce it on a freshly installed operating system and only install the things needed to reproduce the issue. By this it's not affected by any kind of company restrictions or previously installed software or settings from the past. Let me say I learned the above the hard way :) but it's often the golden step in able to reproduce stuff that customers/users report. |
The only functional change is going from: return (T)domain.CreateInstanceAndUnwrap(typeof(T).Assembly.FullName, typeof(T).FullName); to return (T)domain.CreateInstanceFromAndUnwrap(Assembly.GetExecutingAssembly().Location, typeof(T).FullName); At this point I'm not sure how exactly this changes it, but all your info has helped get an actionable repro. |
Community effort for the win!
`typeof(T).Assembly.FullName` and
`Assembly.GetExecutingAssembly().Location` obviously do very different
things. The first returns the assembly name/version/etc, the second
simply the path to the executable.
I suspect using a physical path is leading to the security problem,
but I couldn't say why.
…On Wed, Jan 6, 2021 at 12:09 PM Nikolche Kolev ***@***.***> wrote:
The funny thing is that the issue is not there for version 5.6 even when
the exe is still blocked.
The only functional change is going from:
return (T)domain.CreateInstanceAndUnwrap(typeof(T).Assembly.FullName, typeof(T).FullName);
to
return (T)domain.CreateInstanceFromAndUnwrap(Assembly.GetExecutingAssembly().Location, typeof(T).FullName);
At this point I'm not sure how exactly this changes it, but all your info
has helped get an actionable repro.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9954 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWE24YLSVNSOMYTYVI7PPTSYSYNXANCNFSM4QOQF6VA>
.
|
I was able to solve this quickly - thanks to all who participated especially @lezmaka. |
likely fix...in ProjectFactory::ExtractMetadata |
I can confirm that this bug is present in NuGet V5.9.1.11. If nuget.exe is "blocked" it does not find any meta data of the dll to be packed, uses 1.0.0 as the default version and throws errors regarding "authors" and "description". NuGet shows the following error message while building if it blocked (this is translated to English from the localized error message): Could not load file or assembly "file:///[nuget-dir]\nuget.exe" or one of its dependencies Operation is not supported (Exception from HRESULT: 0x80131515) |
Same story here, but I also noticed strange thing -- I have project using netstandard 2.0 and 2.1 (maybe there are more differences, but this one is the most apparent). I was able to pack NS 2.0 project while when packing NS 2.1 project I got this error "Authors is required". My project "setup" in both cases are identical. I have authors provided in .csproj, and then in .nuspec I have: <authors>$author$</authors> |
Anyone having issues that are not resolved by unblocking NuGet.exe? |
@nkolev92 Me. I was not aware of this unblocking, but nuget didn't raise any errors in regard of safety. In both cases (not unblocked, and unblocked) I have this "Authors is required error". |
I've been trying to make nuget.exe work for an hour now, but no luck, I always get the "Author is required / Description is required" error.
Did I miss something? Is this bug still being worked on? |
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. |
I can confirm that the issue exists on v5.11 and that Unblocking fixes the issue! |
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. |
Version 6.0.0.280 - for me problem exists |
@npakudin |
The real solution of course would be to wrap the program in a proper installer, and then it would not be marked as blocked ;-) |
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 |
In case somebody stumbles on this issue, I just replaced the token The tokenized nuspec file gets generated after running nuget spec in a folder where a .csproj, .vbproj, or .fsproj exists. |
I had same error about Description being required. In my case even though the Changing the |
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
5.7 output
The text was updated successfully, but these errors were encountered: