Why does NuGetPack answer "Unable to create a package that has no dependencies or content"

I am trying to use the following Cake script:

Task("Create-NuGet-Packages")
    .IsDependentOn("Build")
    .WithCriteria(() =>DirectoryExists(parameters.Paths.Directories.NugetNuspecDirectory))
    .Does(() =>
{
    var nuspecFiles = GetFiles(parameters.Paths.Directories.NugetNuspecDirectory + "/**/*.nuspec");

    EnsureDirectoryExists(parameters.Paths.Directories.NuGetPackages);

    foreach(var nuspecFile in nuspecFiles)
    {
        // TODO: Addin the release notes
        // ReleaseNotes = parameters.ReleaseNotes.Notes.ToArray(),

        // Create packages.
        NuGetPack(nuspecFile, new NuGetPackSettings {
            Version = parameters.Version.SemVersion,
            BasePath = parameters.Paths.Directories.PublishedLibraries.Combine(nuspecFile.GetFilenameWithoutExtension().ToString()),
            OutputDirectory = parameters.Paths.Directories.NuGetPackages,
            Symbols = false,
            NoPackageAnalysis = true
        });
    }
});

But I still get the same error:

Error returned from NuGetPack

I confirmed that the generated file *.temp.nuspecdoes indeed contain the correct files and that the files exist in the specified location and that BasePath is correct.

NOTE. . I used -Verbosity Diagnosticto generate the actual command passed to NuGet.exe, and its execution also leads to the same error message. As a result, I do not think that this is a problem directly with Cake, but rather with NuGet.exe.

+3
source share
2 answers

, , . .build\_temp\_PublishedLibraries\Cake.Twitter.

.build BuildArtifacts :

enter image description here

, , , NuGet (, , ):

https://twitter.com/ferventcoder/status/505048107520765952

. , ., nuget.

, ​​ Chocolatey, .

: : https://github.com/NuGet/Home/issues/3308

+5

, / <file src, NuGet .

0

Source: https://habr.com/ru/post/1650220/


All Articles