Unable to pack a Nuget Package on VSTS Unable to cast object of type 'System.String' to type 'NuGet.Frameworks.NuGetFramework'

后端 未结 5 1668
眼角桃花
眼角桃花 2021-01-17 09:58

On running \'pack\' I am getting the following error...

2017-07-05T10:37:09.7762333Z ##[section]Starting: NuGet pack
2017-07-05T10:37:09.7762333Z ===========         


        
相关标签:
5条回答
  • 2021-01-17 10:34

    I had this same issue with my .net standard 2.0 class library I was pack into a nuget package. Here is a screenshot of the step you need to add to replace nuget pack step.

    Step Type To Add Step Type To Add

    Here is how I configured the step Here is how I configured the step

    0 讨论(0)
  • 2021-01-17 10:36

    In VSTS I used "dotnet pack" instead of "nuget pack". So this problem was resolved.

    To publish nuget lib on VSTS, I choiced the following plugins sequence:

    • Get sources
    • nuget restore
    • dotnet build
    • dotnet pack
    • nuget push
    0 讨论(0)
  • 2021-01-17 10:40

    For pack command to work, you need to ensure that the csproj has the following tags:

    <PackageId>*qualified_package_name*</PackageId>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    

    This is particularly relevant if you've migrated from an old-style CSPROJ file

    0 讨论(0)
  • 2021-01-17 10:46

    Using Nuget 4.9.1 version resolved my issue.

    0 讨论(0)
  • 2021-01-17 10:47

    This seems to be an issue using the Nuget pack item built in to VSTS. I swapped it out for a Command Line element to call dotnet pack instead and it now works.

    0 讨论(0)
提交回复
热议问题