Clean / New "Nuget Project" with single Project Reference build Errors

MatthewWaring.4722MatthewWaring.4722 GBUniversity ✭✭
edited March 2018 in Visual Studio

Hi,

With latest tooling, I create a clean "Nuget Package" project, and add a single project reference to another csproj in the solution, on compile I get -

/Users/matthewwaring/.nuget/packages/nuget.build.packaging/0.2.2/build/NuGet.Build.Packaging.targets(50,50): Error MSB4064: The "NuspecFile" parameter is not supported by the "CreatePackage" task. Verify the parameter exists on the task, and it is a settable public instance property. (MSB4064) (xxxx.sdk.package)

/Users/matthewwaring/.nuget/packages/nuget.build.packaging/0.2.2/build/NuGet.Build.Packaging.targets(3,3): Error MSB4063: The "CreatePackage" task could not be initialized with its input parameters. (MSB4063) (xxxx.sdk.package)

The part of the targets file looks like this -

<Target Name="Pack" DependsOnTargets="$(PackDependsOn)" Returns="@(PackageTargetPath)" Condition="'$(IsPackable)' == 'true'">
        <MakeDir Directories="$(PackageOutputPath)" Condition="!Exists('$(PackageOutputPath)')" />
        <CreatePackage Manifest="@(PackageTargetPath)" NuspecFile="$(NuspecFile)" Contents="@(_PackageContent)" TargetPath="@(PackageTargetPath->'%(FullPath)')">
            <Output TaskParameter="OutputPackage" ItemName="_PackageTargetPath" />
            <Output TaskParameter="OutputPackage" ItemName="FileWrites" />

        </CreatePackage>

        <Message Importance="high" Text="Created package at %(_PackageTargetPath.FullPath)." />
    </Target>

Nuget.Build.Packaging 0.2.2

and if I remove the offending NuSpecFile attribute I get -

/Users/matthewwaring/Dev/xxxx/xxxx-xamarin/packages/NuGet.Build.Packaging.0.1.248/build/NuGet.Build.Packaging.targets(3,3): Error: Method 'NuGet.Packaging.ManifestMetadata.set_DependencyGroups' not found. (xxxx-binding)

Hope someone can help
Best
Matt

Tagged:

Best Answer

  • MatthewWaring.4722MatthewWaring.4722 GB ✭✭
    Accepted Answer

    Yep, out of sync Nuget.Build.Packaging files was the culprit of the above error.

    BUT, you may have to do the old clean / delete obj / bin and restart VS4M.

Answers

  • MatthewWaring.4722MatthewWaring.4722 GBUniversity ✭✭

    Have to put hold on this question as tested a clean solution and it only failed when referencing a given project and I think that project had an out of sync Nuget.Build.Packaging nuget in it, will confirm if this is cause of error when tested.

    Thanks

  • MatthewWaring.4722MatthewWaring.4722 GBUniversity ✭✭
    Accepted Answer

    Yep, out of sync Nuget.Build.Packaging files was the culprit of the above error.

    BUT, you may have to do the old clean / delete obj / bin and restart VS4M.

Sign In or Register to comment.