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)
{
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:

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.
source
share