Skip to content

NuGet.exe throws exception 'authors required' during pack of a csproj ignoring placeholders and assemblyinfo attributes if the assembly name is changed #4234

Closed
NuGet/NuGet.Client
#3334

Description

@mawl

Details about Problem

NuGet Version: 3.5.0.1938
On Windows 10

Ignores Placeholder during pack: nuget.exe pack "NugetBug.csproj" -Properties Configuration=Release -Verbosity detailed -Symbols -Version "2.0.0"

Worked before? If so, with which NuGet version
2.8 (and 3.4.x)

Detailed repro steps so we can see the same problem

  1. Use https://github.com/mawl/NugetBug
  2. msbuild /p:Configuration=Release
With 2.8:
C:\projects\csharp\NugetBug\NugetBug>nuget.exe pack "NugetBug.csproj" -Properties Configuration=Release -Verbosity detailed -Symbols -Version "2.0.0"
Es wird versucht, das Paket aus "NugetBug.csproj" zu erstellen.
Paketerstellung der Dateien aus "C:\projects\csharp\NugetBug\NugetBug\bin\Release".
"NugetBug.nuspec" wird für Metadaten verwendet.
Datei "C:\projects\csharp\NugetBug\NugetBug\bin\Release\NugetBug.dll" dem Paket als "lib\net452\NugetBug.dll" hinzufügen

Id: NugetBug
Version: 2.0.0
Authors: Company
Description: Description
Dependencies: None

Die Datei "lib\net452\NugetBug.dll" wurde hinzugefügt.

Das Paket "C:\projects\csharp\NugetBug\NugetBug\NugetBug.2.0.0.nupkg" wurde erfolgreich erstellt.

Es wird versucht, das Symbolpaket für "NugetBug.csproj" zu erstellen.
Paketerstellung der Dateien aus "C:\projects\csharp\NugetBug\NugetBug\bin\Release".
"NugetBug.nuspec" wird für Metadaten verwendet.
Datei "C:\projects\csharp\NugetBug\NugetBug\bin\Release\NugetBug.dll" dem Paket als "lib\net452\NugetBug.dll" hinzufügen
Datei "C:\projects\csharp\NugetBug\NugetBug\bin\Release\NugetBug.pdb" dem Paket als "lib\net452\NugetBug.pdb" hinzufügen
Datei "C:\projects\csharp\NugetBug\NugetBug\Class1.cs" dem Paket als "src\Class1.cs" hinzufügen
Datei "C:\projects\csharp\NugetBug\NugetBug\Properties\AssemblyInfo.cs" dem Paket als "src\Properties\AssemblyInfo.cs" hinzufügen

Id: NugetBug
Version: 2.0.0
Authors: Company
Description: Description
Dependencies: None

Die Datei "lib\net452\NugetBug.dll" wurde hinzugefügt.
Die Datei "lib\net452\NugetBug.pdb" wurde hinzugefügt.
Die Datei "src\Class1.cs" wurde hinzugefügt.
Die Datei "src\Properties\AssemblyInfo.cs" wurde hinzugefügt.

Das Paket "C:\projects\csharp\NugetBug\NugetBug\NugetBug.2.0.0.symbols.nupkg" wurde erfolgreich erstellt.

With 3.5.x
C:\projects\csharp\NugetBug\NugetBug>c:\tmp\nuget-3.5.exe pack "NugetBug.csproj" -Properties Configuration=Release -Verbosity detailed -Symbols -Version "2.0.0"
NuGet Version: 3.5.0.1938
Es wird versucht, das Paket aus "NugetBug.csproj" zu erstellen.
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
Paketerstellung der Dateien aus "C:\projects\csharp\NugetBug\NugetBug\bin\Release".
"NugetBug.nuspec" wird für Metadaten verwendet.
System.Exception: Authors is required.
Description is required.
   bei NuGet.Packaging.Manifest.Validate(Manifest manifest)
   bei NuGet.Packaging.Manifest.ReadFrom(Stream stream, Func`2 propertyProvider, Boolean validateSchema)
   bei NuGet.CommandLine.ProjectFactory.ProcessNuspec(PackageBuilder builder, String basePath)
   bei NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded)
   bei NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
   bei NuGet.Commands.PackCommandRunner.BuildPackage(String path)
   bei NuGet.Commands.PackCommandRunner.BuildPackage()
   bei NuGet.CommandLine.PackCommand.ExecuteCommand()
   bei NuGet.CommandLine.Command.ExecuteCommandAsync()
   bei NuGet.CommandLine.Command.Execute()
   bei NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)

...

Other suggested things

Placeholder were ignored.

Activity

  1. changed the title [-]nuget cli 3.5.0 throws exception during pack of a csproj (using placeholders)[/-] [+]nuget cli 3.5.0 throws exception authors required during pack of a csproj ignoring placeholders and assemblyinfo attributes[/+] on Jan 9, 2017
  2. changed the title [-]nuget cli 3.5.0 throws exception authors required during pack of a csproj ignoring placeholders and assemblyinfo attributes[/-] [+]nuget cli 3.5.0 throws exception 'authors required' during pack of a csproj ignoring placeholders and assemblyinfo attributes[/+] on Jan 9, 2017
  3. JohannesDrexler commented on Jan 20, 2017

    @JohannesDrexler

    I have exact the same issue.

  4. JohannesDrexler commented on Jan 20, 2017

    @JohannesDrexler

    I downloaded nuget.exe 3.4.4 and it worked again so it seems the bug was introduced in 3.5

  5. rohit21agrawal commented on Jan 20, 2017

    @rohit21agrawal
    Contributor

    @JohannesDrexler @mawl This is actually a different bug : #3146

    If you change the name of your nuget-3.5.exe to nuget.exe, it should work for you.

  6. JohannesDrexler commented on Jan 20, 2017

    @JohannesDrexler

    @rohit21agrawal the nuget.exe in my project is named nuget.exe and it doesn't work. Im creating a repro project now

  7. rohit21agrawal commented on Jan 20, 2017

    @rohit21agrawal
    Contributor

    please include the nuget.exe in your repro project as well.

  8. rohit21agrawal commented on Jan 20, 2017

    @rohit21agrawal
    Contributor

    the repro project provided by @mawl actually works well with nuget.exe 3.5.0 RTM (build 1938). Attaching the project with its build result and the nuget.exe used.

    NugetBug.zip

  9. JohannesDrexler commented on Jan 20, 2017

    @JohannesDrexler

    I am having problems recreating this issue but i don't want to attach the original project where it occures.
    In the project where it occured the "Author" and "Description" were included as a shared AssemblyInfo.cs that was included as "LinkedFile" in the project

  10. thoemmi commented on Jan 31, 2017

    @thoemmi

    I'm facing the same issue in my project: in the nuspec file I'm using $author$ and $description$, which -- according to the documentation -- should be replaced with the content of the assembly attributes AssemblyCompany and AssemblyDescription respectively.

    However, NuGet v3.5 (and even the current NuGet/NuGet.Client@04f9b91 ) says

    Attempting to build package from 'TinyLittleMvvm.nuspec'.
    Authors is required.
    Description is required.
    Press any key to continue . . .

  11. rohit21agrawal commented on Jan 31, 2017

    @rohit21agrawal
    Contributor

    @thoemmi i would be more than happy to take a look if you could tell me the repro steps for your project..

  12. 38 remaining items

  13. self-assigned this
    on Apr 8, 2020
  14. changed the title [-]nuget cli 3.5.0 throws exception 'authors required' during pack of a csproj ignoring placeholders and assemblyinfo attributes if the assembly name is changed[/-] [+]nuget cli throws exception 'authors required' during pack of a csproj ignoring placeholders and assemblyinfo attributes if the assembly name is changed[/+] on Aug 22, 2020
  15. changed the title [-]nuget cli throws exception 'authors required' during pack of a csproj ignoring placeholders and assemblyinfo attributes if the assembly name is changed[/-] [+]NuGet.exe throws exception 'authors required' during pack of a csproj ignoring placeholders and assemblyinfo attributes if the assembly name is changed[/+] on Aug 22, 2020
  16. bladewolf55 commented on Aug 28, 2020

    @bladewolf55

    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.

    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)
    
  17. bladewolf55 commented on Aug 28, 2020

    @bladewolf55

    I see the original thread is closed. Should I start a new one, or can this be reopened?

  18. zivkan commented on Aug 28, 2020

    @zivkan
    Member

    I think it's better to start a new thread. This thread was closed when a PR was merged, meaning this issue is linked to our release notes.

  19. nkolev92 commented on Aug 28, 2020

    @nkolev92
    Member

    @bladewolf55

    The change for this particular issue is in 5.7, not 5.6.

  20. sintecnos-lucabiffi commented on Oct 7, 2020

    @sintecnos-lucabiffi

    I'm using NuGet 5.7.0.6726 and this still has to be fixed

  21. bladewolf55 commented on Oct 7, 2020

    @bladewolf55

    @sintecnos-lucabiffi You might add your comment to the new thread so it's clear the issue exists in the latest build.

    #9954

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions