fsprojects / Paket

A dependency manager for .NET with support for NuGet packages and Git repositories.
https://fsprojects.github.io/Paket/
MIT License
2.02k stars 520 forks source link

Paket.Restore.targets error MSB4064: The "Readme" parameter is not supported by the "PackTask" task loaded from assembly: NuGet.Build.Tasks.Pack, Version=5.6.0.5, #4213

Open Leomana8 opened 1 year ago

Leomana8 commented 1 year ago

Description

I have an error when building a solution by msbuild.exe C:\Agents\agent1\_work\5\s\Tests\.paket\Paket.Restore.targets(368,15): error MSB4064: The "Readme" parameter is not supported by the "PackTask" task loaded from assembly: NuGet.Build.Tasks.Pack, Version=5.6.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35 from the path: C:\Program Files\dotnet\sdk\3.1.302\Sdks\NuGet.Build.Tasks.Pack\Desktop\NuGet.Build.Tasks.Pack.dll. Verify that the parameter exists on the task, the <UsingTask> points to the correct assembly, and it is a settable public instance property. Paket.Restore.targets(322,5): error MSB4063: The "PackTask" task could not be initialized with its input parameters.

Repro steps

  1. My Solution has projects netstandard2.0 with GeneratePackageOnBuild and projects .netcore3.1, Framework 4.6.2. csproj:
    <TargetFramework>netstandard2.0</TargetFramework>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
  2. Paket version 7.2.1+8e4eb74b42fbd45f39f7afce9184c16ebb65f16c
  3. paket restore and dotnet restore
  4. restore generated Paket.Restore.targets
    ....
    <!-- Call Pack -->
    <PackTask Condition="$(UseMSBuild16_10_Pack)"
              PackItem="$(PackProjectInputFile)"
              PackageFiles="@(_PackageFiles)"
              PackageFilesToExclude="@(_PackageFilesToExclude)"
              PackageVersion="$(PackageVersion)"
              PackageId="$(PackageId)"
              Title="$(Title)"
              Authors="$(Authors)"
              Description="$(Description)"
              Copyright="$(Copyright)"
              RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
              LicenseUrl="$(PackageLicenseUrl)"
              ProjectUrl="$(PackageProjectUrl)"
              IconUrl="$(PackageIconUrl)"
              ReleaseNotes="$(PackageReleaseNotes)"
              Tags="$(PackageTags)"
              DevelopmentDependency="$(DevelopmentDependency)"
              BuildOutputInPackage="@(_BuildOutputInPackage)"
              TargetPathsToSymbols="@(_TargetPathsToSymbols)"
              SymbolPackageFormat="$(SymbolPackageFormat)"
              TargetFrameworks="@(_TargetFrameworks)"
              AssemblyName="$(AssemblyName)"
              PackageOutputPath="$(PackageOutputAbsolutePath)"
              IncludeSymbols="$(IncludeSymbols)"
              IncludeSource="$(IncludeSource)"
              PackageTypes="$(PackageType)"
              IsTool="$(IsTool)"
              RepositoryUrl="$(RepositoryUrl)"
              RepositoryType="$(RepositoryType)"
              SourceFiles="@(_SourceFiles->Distinct())"
              NoPackageAnalysis="$(NoPackageAnalysis)"
              MinClientVersion="$(MinClientVersion)"
              Serviceable="$(Serviceable)"
              FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
              ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
              NuspecOutputPath="$(AdjustedNuspecOutputPath)"
              IncludeBuildOutput="$(IncludeBuildOutput)"
              BuildOutputFolders="$(BuildOutputTargetFolder)"
              ContentTargetFolders="$(ContentTargetFolders)"
              RestoreOutputPath="$(RestoreOutputAbsolutePath)"
              NuspecFile="$(NuspecFileAbsolutePath)"
              NuspecBasePath="$(NuspecBasePath)"
              NuspecProperties="$(NuspecProperties)"
              PackageLicenseFile="$(PackageLicenseFile)"
              PackageLicenseExpression="$(PackageLicenseExpression)"
              PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
              Readme="$(PackageReadmeFile)"
              NoDefaultExcludes="$(NoDefaultExcludes)"/>
              ...

    Readme="$(PackageReadmeFile)"

  5. global.json "3.1.103", "3.1.302"
    {
    "sdk": {
    "version": "3.1.103",
    "rollForward": "latestFeature"
    }
    }
  6. "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" current.sln /p:VisualStudioVersion="16.0"

Expected behavior

Success result

Actual behavior

\.paket\Paket.Restore.targets(368,15): error MSB4064: The "Readme" parameter is not supported by the "PackTask" task loaded from assembly: NuGet.Build.Tasks.Pack, Version=5.6.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35 from the path: C:\Program Files\dotnet\sdk\3.1.302\Sdks\NuGet.Build.Tasks.Pack\Desktop\NuGet.Build.Tasks.Pack.dll. Verify that the parameter exists on the task, the <UsingTask> points to the correct assembly, and it is a settable public instance property. 
\.paket\Paket.Restore.targets(322,5): error MSB4063: The "PackTask" task could not be initialized with its input parameters.  

Known workarounds

Visual Studio Build Tools 16.11.27